Page 1 of 1

Cobol File with Multiple record layout.

Posted: Thu Oct 13, 2011 2:57 pm
by kollurianu
Hi All,

We are getting Cobol Input file with multiple record layout with different lengths and each record layout in it is a fixed format. There are 60types of records/record layouts in the input file and we are interested only in 10 of them. But we have seperate copybooks for each type of layout.

Tried to read and extract each record type in a seperate job, then it is throwing bunch warnings of unread record types as below.

Source_File,0: Tag value: AM01 does not match any tagcase for tagged field "source_file_record_type" .
Source_File,0: Import warning at record 57.

Is there a way to handle this, when we want to read each type of record in a seperate job , as copybooks are provided seperately , though the input file has all types of records in it without getting any warnings?

Any thoughts/inputs greatly appreciated.

Thanks in advance.

Posted: Fri Oct 14, 2011 12:34 pm
by FranklinE
If: The record type field is in the same position and of the same length in very record, I would start with a master-split job that creates one file per type. Your schema would be a record type column and one VarChar with a max length of your longest record. Then write your main jobs customized for each record type, or if you really must keep it in one job do a multi-link filter stage instead of files and parse each link in a transformer to the copybook.

It is very easy to try to do too much in one job when reading COBOL formatted data.

Posted: Fri Oct 14, 2011 1:38 pm
by arunkumarmm
You dont need to have a seperate job for each record type. You can do that in the CFF stage with one output link for each record type. In CFF stage, on the Records tab, unselect the single record option, add 10 records to it. Import the 10 copybooks you need, one in each of them.

Then if you have a column that differentiates each record type, use that in the constrain in 'Record ID tab. Or you should be able differentiate them using the RDW_WIDTH, which will actually have the lenght of each record in a VB file.

Define 10 output links and map one record to one link. Hope this helps.