Kolusu, I ran these statements and found the job to be incredibly fast. I
added an INCLUDE COND statement to filter out only what I needed (based on
the IfThen statements at the top), and was able to process
a 21,403,200-record file to produce 1,633,601 output records in only 20
seconds!

I also downloaded the file and opened the CSV with Microsoft Excel, and
could manipulate the display with sorts and filters as was needed.

All in all, this was a great learning experience for me, and a great start
to the new year! Thanks once more for all your help!

Billy

On Wed, Jan 3, 2018 at 5:47 PM, Sri h Kolusu <[email protected]> wrote:

> Bill,
>
> Here is a JCL which will give you the desired results. SORTOUT will have
> your Mainframe File and CSVFILE will have the comma separated data
>
> //STEP0100 EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=YOUR INPUT FB 80 BYTE FILE
> //SORTOUT  DD SYSOUT=*
> //CSVFILE  DD SYSOUT=*
> //SYSIN    DD *
>   OPTION COPY
>
>   INREC IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
>          PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50)),
>          BUILD=(001:%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=53),
>                 301:%01)),
>
>         IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
>          PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5)),
>          BUILD=(054:%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=08),
>                 351:%02)),
>
>         IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
>          PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50)),
>          BUILD=(062:%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=53),
>                 356:%03)),
>
>         IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
>          PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3)),
>          BUILD=(115:%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=06),
>                 406:%04)),
>
>         IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
>          PARSE=(%05=(ABSPOS=12,ENDBEFR=C'  ',FIXLEN=50)),
>          BUILD=(121:%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=53),
>                 409:%05)),
>         IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
>          PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
>                 %07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15)),
>          BUILD=(174:%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=6),
>                 180:%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=18),
>                 459:%06,
>                 462:%07)),
>
>         IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
>          PARSE=(%08=(ABSPOS=13,ENDBEFR=C'  ',FIXLEN=50)),
>        OVERLAY=(198:%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=53),
>                 477:%08)),
>
>         IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
>            PARSE=(%09=(ABSPOS=06,FIXLEN=3),
>                   %10=(ABSPOS=10,FIXLEN=2),
>                   %11=(ABSPOS=13,FIXLEN=1),
>                   %12=(ABSPOS=15,FIXLEN=1),
>                   %13=(ABSPOS=17,FIXLEN=10)),
>        OVERLAY=(251:%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=6),
>                 257:%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=5),
>                 262:%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=4),
>                 266:%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
>                              LENGTH=4),
>                 270:%13,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',
>                              LENGTH=12),
>                 282:C'P',
>                 527:%09,
>                 530:%10,
>                 532:%11,
>                 533:%12,
>                 534:%13))
>
>   OUTREC  IFTHEN=(WHEN=GROUP,BEGIN=(001,1,CH,EQ,C'"'),
>                   PUSH=(001:001,53,301:301,50)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(054,1,CH,EQ,C'"'),
>                   PUSH=(054:054,08,351:351,05)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(062,1,CH,EQ,C'"'),
>                   PUSH=(062:062,53,356:356,50)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(115,1,CH,EQ,C'"'),
>                   PUSH=(115:115,06,406:406,03)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(121,1,CH,EQ,C'"'),
>                   PUSH=(121:121,53,409:409,50)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(174,1,CH,EQ,C'"'),
>                   PUSH=(174:174,06,459:459,03)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(180,1,CH,EQ,C'"'),
>                   PUSH=(180:180,18,462:462,15)),
>           IFTHEN=(WHEN=GROUP,BEGIN=(198,1,CH,EQ,C'"'),
>                   PUSH=(198:198,53,477:477,50))
>
>   OUTFIL INCLUDE=(282,1,CH,EQ,C'P'),
>          BUILD=(301,243)
>
>   OUTFIL FNAMES=CSVFILE,INCLUDE=(282,1,CH,EQ,C'P'),
>          BUILD=(001,281,SQZ=(SHIFT=LEFT,PAIR=QUOTE))
> /*
>
> Thanks,
> Kolusu
> DFSORT Development
> IBM Corporation
>
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to