Page 1 of 1

PARSE more than 100 fields

Posted: Mon Feb 01, 2016 8:37 pm
by Srikrishna116
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.

Posted: Mon Feb 01, 2016 8:38 pm
by Srikrishna116
Correction of SORT card of my previous post

OUTREC PARSE=(%1=(ENDBEFR=C'~',FIXLEN=24,REPEAT=8 ),

BUILD=(%1,%2,%3,%4,%5,%6,%7,%8 )

Posted: Mon Feb 01, 2016 9:45 pm
by William Collins
When DFSORT introduced REPEAT= on PARSE, they extended the number of PARSEd fields to 1000.

If you don't have 1000 PARSEd fields available, things become more tricky.

Topic deleted by Admin

Posted: Mon Feb 01, 2016 9:59 pm
by academyindia4
<< Content deleted By Admin >>

Posted: Tue Feb 02, 2016 7:31 am
by Srikrishna116
William Collins,
Thanks for your response. But am sorry that I didnt mention that I am using SYNCSORT utility..I tried using %998,%999 but got an error "NUMERIC FIELD ERROR"

Posted: Tue Feb 02, 2016 2:44 pm
by William Collins
Don't worry, you mentioned it previously. If SyncSORT has only 99 PARSEd fields, there's a problem with the approach.

You could consider writing a COBOL E15 exit.

Or you could continue, with a multi-step approach.

Whichever, make sure you have everything nailed-down and designed before you start coding.

Topic deleted by Admin

Posted: Wed Feb 03, 2016 12:52 am
by academyindia4
<< Content deleted By Admin >>