Migration From COBOL data file to SQL Server using SSIS
Dear All , Good day and I hope all is well , I have case on my hand I need to migrate data from COBOL files using SSIS is this possible even that I have COBOL Record Layout . please any hints or guide in this task . thanks the type of file is COBOL File , with fix-width sample of record layout is : 01 lnrq. 02 lnrqst-key. 04 brnch-cd-lnq pic 99. 04 ln-type-lnq pic 9. 88 general-ln-lnq value 0. 88 prfsnl-ln-lnq value 1. 04 lnrq-cd-lnq pic 9(9). 02 lnrq-dt-lnq. 04 lnrq-yr-lnq pic 9(4). 04 lnrq-mn-lnq pic 9(2). 04 lnrq-dy-lnq pic 9(2). 02 ln-type-key-lnq. I have also the COBOL data file , my question is it possible to migrate using SSIS ? thanks in advance
If the file is a fixed width then the flat file connector will allow you to define the column widths within an SSIS package. I would certainly give it a try. What is the file extension and can you supply a sample of the file format in your question? you may also be able to use something like LogParser or ReLog to format/import the data.
Not sure how you would handle REDEFINES (if you have any) in SSIS, as that is essentially determining the structure of the file based upon the content, presumably you could parse it conditionally. One thing to consider might be *signed numeric fields*, where the least significant character is coded to include the sign (+/-) - more details [here] - so a value -12 might be represented as `1K`. I'd be pretty surprised if you can't do this in SSIS, having said that though, I currently do something similar using [BULK INSERT], mainly because I'm more comfortable using T-SQL than SSIS! :
I don't know the COBOL data files, but generally you can import any type of file using SSIS if you know how to process the input file. If you know the structure and know how to process the input file, you can use the Script Component in the data flow of SSIS as Source and write a code to open and process the input file and return the rows into the data flow. After that you have rows in SSIS and you can process them further and store them to destination.