CFF - occurs depending on clause
Posted: Tue Mar 12, 2019 8:55 am
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.
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.