Cobol File with Multiple record layout.

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Cobol File with Multiple record layout.

Post 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.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post 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.
Arun
Post Reply