Unable to read all records from cobol file using CFF stage

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
romil_ds
Participant
Posts: 6
Joined: Mon Dec 28, 2009 5:14 am
Location: New Delhi

Unable to read all records from cobol file using CFF stage

Post by romil_ds »

Hi All,

I have a cobol file containing 6 different format of records. Using copy codes for each type of records I am able to read the first 5 records through CFF stage but not the 6th and subsequent records.

The column definition for that record is also correctly defined.

Also I have defined one of them as a master record.

When I break the file into 6 parts using script wherein the similar format records are grouped into each part then by using the same table definition for each record type I am able to read each part successfully through CFF stage.

But I dont want script to come into picture.

Can you tell me the possible reason for not reading the original file completely and solution as well.


Thanks
Romil Agarwal
TCS
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Romil, I may be missing something, but it looks like you are working against the DataStage weakness in handling Cobol formats that use redefines at the record level. Your reference to a "master record" leads me to that assumption.

My suggestion is based on the assumption that the record-type field is the first column in the table.

In CFF, use a two-column table definition, the record-type column and a varchar column for the rest of the record. Then use a Filter (or similar) stage to determine what kind of record you have, and branch each link so you can define the record types as separate tables. How that might work for the rest of your job may be a problem, but it's where I might start with it.
romil_ds
Participant
Posts: 6
Joined: Mon Dec 28, 2009 5:14 am
Location: New Delhi

Post by romil_ds »

Hi Frankline,

Thanks for your quick reply.

I have already done exatclty in the same way and it was a successful attempt. I was able to separate similar format records into single cff file and then read that file again using cff stage file proper record definition with no record_id since the file contains only one type of records now.

But again it is adding one more steps to the process i.e. first break the file into 6 parts and then read each file again as cobol input file.

What I am confused is why the cff stage is not able to read it in one step directly into individual columns.
Romil Agarwal
TCS
Post Reply