PARSE more than 100 fields
Posted: Mon Feb 01, 2016 8:37 pm
Hi,
Can someone please help me regarding my below query?
I got stuck with the parsing of below copybook layout.
01 EX-Field OCCURS 75 times.
10 Field3 PIC X(04).
10 Field4 PIC 9(10).
10 Field5 PIC X(24).
10 Field6 PIC X(17).
My input file has data like below:
HeaderYYYYMMDD
NField1~Field2~Field3(1)~Field4(1)~Field5(1)~Field6(1)~Field3(2)~Field4(2)~Field5(2)~Field6(2)
VField1Datatype~Field2Datatype~Field3(1)Datatype~Field4(1)Datatype~Field5(1)Datatype~Field6(1)Datatype~Field3(2)Datatype and so on
D111~abcd~G12~~~H773 and so on
D2222~abc~G443~H553~G663~H774 and so on
Trailer0002
I used REPEAT in the case if Field3, Field4, Field5, Field6 occurs 2 times and so I used below card
OUTREC PARSE=(%1=(ENDBEFR=C'~',FIXLEN=24,REPEAT=8)),
BUILD=(%1,%2,%3,%4,%5,%6,%7,%8)
But in case of OCCURS 75 times, 75 * 4 = %300 which is exceeding limit of %100.
I thought of using temporary data sets but its of too much complexity.
Please help me to achieve this. I would be grateful for your help.
Can someone please help me regarding my below query?
I got stuck with the parsing of below copybook layout.
01 EX-Field OCCURS 75 times.
10 Field3 PIC X(04).
10 Field4 PIC 9(10).
10 Field5 PIC X(24).
10 Field6 PIC X(17).
My input file has data like below:
HeaderYYYYMMDD
NField1~Field2~Field3(1)~Field4(1)~Field5(1)~Field6(1)~Field3(2)~Field4(2)~Field5(2)~Field6(2)
VField1Datatype~Field2Datatype~Field3(1)Datatype~Field4(1)Datatype~Field5(1)Datatype~Field6(1)Datatype~Field3(2)Datatype and so on
D111~abcd~G12~~~H773 and so on
D2222~abc~G443~H553~G663~H774 and so on
Trailer0002
I used REPEAT in the case if Field3, Field4, Field5, Field6 occurs 2 times and so I used below card
OUTREC PARSE=(%1=(ENDBEFR=C'~',FIXLEN=24,REPEAT=8)),
BUILD=(%1,%2,%3,%4,%5,%6,%7,%8)
But in case of OCCURS 75 times, 75 * 4 = %300 which is exceeding limit of %100.
I thought of using temporary data sets but its of too much complexity.
Please help me to achieve this. I would be grateful for your help.