PARSE more than 100 fields

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Srikrishna116
Member
Posts: 8
Joined: Thu Jan 28, 2016 3:31 pm

PARSE more than 100 fields

Post by Srikrishna116 » 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.
Thanks,
Srikrishna

Srikrishna116
Member
Posts: 8
Joined: Thu Jan 28, 2016 3:31 pm

Post by Srikrishna116 » Mon Feb 01, 2016 8:38 pm

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 )
Thanks,
Srikrishna

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Feb 01, 2016 9:45 pm

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.

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Feb 01, 2016 9:59 pm

<< Content deleted By Admin >>

Srikrishna116
Member
Posts: 8
Joined: Thu Jan 28, 2016 3:31 pm

Post by Srikrishna116 » Tue Feb 02, 2016 7:31 am

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"
Thanks,
Srikrishna

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Feb 02, 2016 2:44 pm

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.

academyindia4

Topic deleted by Admin

Post by academyindia4 » Wed Feb 03, 2016 12:52 am

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others