CFF - occurs depending on clause

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
naveen7690
Participant
Posts: 1
Joined: Tue Mar 12, 2019 8:07 am

CFF - occurs depending on clause

Post by naveen7690 »

Hi All,

I've been searching a lot of posts for a solution on handling a cobol EBCDIC file with occurs depending on clause. Kindly help/suggest me on how to proceed further:

File Type: EBCDIC, Fixed width

I have few amount fields(sub records) for each record type which can occur upto 40 times based on a count field(integer). I've managed to flatten it into a single record , each having all the 40 sub groups. Now I've to load them into my DB and the table load requirement is such that each subgroup is loaded record wise instead of a single record having account_id has a reduntant field.

My Copybook(example):

01 RECORD ID
01 ACCOUNT ID
01 COUNT
01 AMOUNT occurs 40 times depending on COUNT
02 AMOUNT_DATE
02 AMOUNT_TRANS_ID

(i've overall 100 fields in level 1 and approx 50 fields in lvl 2)

My table load requirement:
ACCOUNT_ID|AMOUNT_DATE|AMOUNT_TRANS_ID
123|xyz|abc
123|pqr|def
456|ymd|abc
456|ymd|def
456|ymd|ghi
etc (single account can have all 40 sub records under the same schema)

Please suggest a possible solution. As the records are dynamic based on the count field , DBA doesnt want a lot of nulls and mulitple fields with 0 data.
thanks&Regards
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

The FAQs at the end of my post will give you more general assistance with COBOL/EBCDIC data.

The latest wisdom from IBM references version 9.1, but it might still be true.

https://www.ibm.com/support/knowledgece ... Stage.html

The first links says that if you have OCCURS DEPENDING, you should use variable-block type:

Block type. Select the block type of the source file. The default is Fixed block file, which indicates that the source file contains fixed record lengths. Complex Flat File stages can also be used to read variable-block files with or without OCCURS DEPENDING ON clauses.

Array handling in CFF: https://www.ibm.com/support/knowledgece ... Stage.html
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
Post Reply