I am new to mainframe jobs...
I have a similar situation.
My mainframe source file has header, data and trailer records.
So I am using a Multi format flat file, and using constraints to identify the records and it works fine.
In data record, I have an occurs clause - 6 times, and I setelect flatten all arrays, so I have all the columns appearing 6 times - with the suffix _1,2,3,4,5,6.
Now I have got them in my output tab of the MFF stage and my rest of the job has a transfomer and few fixed with flat file stages.
My input to transfoemer has say for eg: client_1, 2,3,4,5,6 and output file has only one client column.
How do I map this?....
I havent done this before and need help
Many thanks.
And here are my CFDs...
* DATA EXTRACT RECORD
01 ABC-CLIENT-ACCOUNT.
05 ABC-CONTROL-SECTION.
10 ABC-SYSTEM-ID PIC X(03).
10 ABC-ACCOUNT-NUMBER PIC X(12).
10 ABC-NUM-OF-CLIENTS PIC 9(02).
10 ABC-LEVEL-3-4-IND PIC 9(01).
88 ABC-LEVEL-3-AMA VALUE '3'.
88 ABC-LEVEL-4-EQS VALUE '4'.
10 ABC-ACCOUNT-STATUS PIC X(01).
88 ABC-OPEN VALUE 'O'.
88 ABC-CLOSED VALUE 'C'.
10 ABC-ACCOUNT-TERM-REASON PIC X(01).
88 ABC-RESTRICTED VALUE 'R'.
88 ABC-NOT-RESTRICTED VALUE ' '.
10 ABC-BDDS-PLAN-CODE.
15 ABC-PLAN-CODE PIC X(04).
15 FILLER PIC X(0.
10 ABC-TIN-TYPE-CODE PIC X(01).
10 ABC-ACCOUNT-TAXPAYER-ID PIC X(09).
10 ABC-REG-NAME-LINE1 PIC X(50).
10 ABC-REG-NAME-LINE2 PIC X(50).
10 ABC-REG-NAME-LINE3 PIC X(50).
10 ABC-REG-ADDRESS-LINE1 PIC X(50).
10 ABC-REG-ADDRESS-LINE2 PIC X(50).
10 ABC-REG-CITY-LINE PIC X(20).
10 ABC-REG-STATE-CODE PIC X(02).
10 ABC-REG-ZIP-CODE PIC X(09).
10 ABC-DATE-OPENED PIC X(0.
10 ABC-DATE-CLOSED PIC X(0.
******************************************************************
* ABC-CLIENT-INFORMATION OCCURS 6 TIMES *
******************************************************************
05 ABC-CLIENT-INFORMATION OCCURS 6 TIMES.
10 ABC-CLIENT-TYPE PIC X(01).
88 ABC-INDIVIDUAL VALUE 'I'.
88 ABC-CORPORATE VALUE 'C'.
88 ABC-TRUST VALUE 'T'.
10 ABC-CLIENT-ROLE PIC X(02).
88 ABC-PRIMARY-OWNER VALUE '00'.
88 ABC-CO-OWNER VALUE '01'.
10 ABC-TAXPAYER-ID PIC X(09).
10 ABC-TAXPAYER-ID-TYPE PIC X(01).
88 ABC-INDIV-SSN VALUE '0'.
88 ABC-ORG-TIN VALUE '1'.
88 ABC-UNKNOWN VALUE ' '.
10 ABC-NAME-LOOKUP PIC X(25).
10 ABC-GENDER PIC X(01).
88 ABC-MALE VALUE 'M'.
88 ABC-FEMALE VALUE 'F'.
88 ABC-UNKNOWN VALUE ' '.
10 ABC-DATE-OF-BIRTH PIC X(0.
10 ABC-NAME-LAST PIC X(100).
10 ABC-NAME-FIRST PIC X(50).
10 ABC-NAME-MIDDLE PIC X(50).
10 ABC-NAME-SUFFIX PIC X(20).
10 ABC-ADDRESS-LINE1 PIC X(50).
10 ABC-ADDRESS-LINE2 PIC X(50).
10 ABC-CITY PIC X(50).
10 ABC-STATE-CODE PIC X(02).
10 ABC-ZIP-CODE PIC X(09).
TARGET RECORD:
01 SPLTC-CUSTOMER-RECORD.
05 SPLTC-SYSTEM-SOURCE PIC X(01).
05 SPLTC-POLICY-NUMBER PIC X(12).
05 SPLTC-CUSTOMER-OCCRNCE PIC 9(02).
05 SPLTC-CUSTOMER-TYPE PIC X(01).
05 SPLTC-UNIT-SUBUNIT-NUMBER PIC 9(10).
05 SPLTC-UNIT-INDICATOR PIC X(01).
05 SPLTC-TITLE-ID PIC X(02).
05 SPLTC-NAME PIC X(46).
05 SPLTC-ADDR-1 PIC X(35).
05 SPLTC-ADDR-2 PIC X(35).
05 SPLTC-ADDR-3 PIC X(35).
05 SPLTC-ADDR-4 PIC X(35).
05 SPLTC-ADDR-5 PIC X(35).
05 SPLTC-TYPE-FEDERAL-ID PIC X(01).
05 SPLTC-FEDERAL-ID PIC 9(10).
05 SPLTC-SEX PIC X(01).
05 SPLTC-DATE-OF-BIRTH.
10 SPLTC-DOB-CENT PIC 9(02).
10 SPLTC-DOB-YEAR PIC 9(02).
10 SPLTC-DOB-MONTH PIC 9(02).
10 SPLTC-DOB-DAY PIC 9(02).
05 SPLTC-CLIENT-STATUS PIC 9(02).
05 SPLTC-DATE-OF-DEATH.
10 SPLTC-DOD-CENT PIC 9(02).
10 SPLTC-DOD-YEAR PIC 9(02).
10 SPLTC-DOD-MONTH PIC 9(02).
10 SPLTC-DOD-DAY PIC 9(02).
05 SPLTC-PREM-TAX-CITY PIC 9(03).
05 SPLTC-ALIAS PIC X(46).
05 SPLTC-HANDLING-CODE PIC X(01).
05 SPLTC-NOTICE-ID PIC 9(01).
05 SPLTC-POLICY-STOP PIC X(02).
05 SPLTC-UPDATE-INDICATOR PIC X(01).
05 SPLTC-UNDELIVER-MAIL-IND PIC X(01).
05 FILLER PIC X(15) VALUE SPACES.
Multi format flat file - handling occurs clause
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 39
- Joined: Tue Dec 23, 2003 3:47 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I am failing to see six 05-level items to receive the flattened OCCURS item ABC-CLIENT-INFORMATION in your target record.
05 SPLTC-CLIENT-INFORMATION-01.
10 SPLTC-CLIENT-INFORMATION-01-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-01-CLIENT-ROLE PIC X(2).
etc.
05 SPLTC-CLIENT-INFORMATION-02.
10 SPLTC-CLIENT-INFORMATION-02-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-02-CLIENT-ROLE PIC X(2).
etc.
05 SPLTC-CLIENT-INFORMATION-06.
10 SPLTC-CLIENT-INFORMATION-06-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-06-CLIENT-ROLE PIC X(2).
etc.
Also, I'm not 100% certain that DataStage "likes" working storage (88-level items) in file definitions.
05 SPLTC-CLIENT-INFORMATION-01.
10 SPLTC-CLIENT-INFORMATION-01-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-01-CLIENT-ROLE PIC X(2).
etc.
05 SPLTC-CLIENT-INFORMATION-02.
10 SPLTC-CLIENT-INFORMATION-02-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-02-CLIENT-ROLE PIC X(2).
etc.
05 SPLTC-CLIENT-INFORMATION-06.
10 SPLTC-CLIENT-INFORMATION-06-CLIENT-TYPE PIC X.
10 SPLTC-CLIENT-INFORMATION-06-CLIENT-ROLE PIC X(2).
etc.
Also, I'm not 100% certain that DataStage "likes" working storage (88-level items) in file definitions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Your target layout looks like it is expecting a single client. Is the requirement to map one output client per input record? If that is the case, then you need a requirement that tells you which of the potentially six client records to map to your output (and then the mapping is trivial).
If your intent was to write out up to six output client records for each input record, then you should not have flattened the array (you should've normalized it). If you normalize it, then the mapping will be trivial and DataStage will always create six output client records for each input record. If some of the client occurrences are optional (seems likely), then you can add an output constraint to filter out the "blank" client records.
Mike
If your intent was to write out up to six output client records for each input record, then you should not have flattened the array (you should've normalized it). If you normalize it, then the mapping will be trivial and DataStage will always create six output client records for each input record. If some of the client occurrences are optional (seems likely), then you can add an output constraint to filter out the "blank" client records.
Mike
-
- Premium Member
- Posts: 39
- Joined: Tue Dec 23, 2003 3:47 am
- Location: India
Yes , exactly. I had to apply a filter, I did and it works correctly now.
=>Also I wanted to get the 20 rows for one output file (flattened)
=>and no.of occurs * no. of rows (like 6 occurs* 20 rows = 120) in other output file
(normalised)
I had to use 2 seperate jobs to achieve this. One with falttened arrays and other with normalised arrays on the same input file.
Just wanted to share.
Thanks for all your help.
=>Also I wanted to get the 20 rows for one output file (flattened)
=>and no.of occurs * no. of rows (like 6 occurs* 20 rows = 120) in other output file
(normalised)
I had to use 2 seperate jobs to achieve this. One with falttened arrays and other with normalised arrays on the same input file.
Just wanted to share.
Thanks for all your help.