Join this group to access featured content and participate in discussions related to all Syncsort Mainframe Products.

112 Members
Join Us!

Convert Help

Hello,

I recently wrote two distinct sort steps in JCL to convert a 512 byte VB file to an 80 byte FB file. The first sort step reformats the record and writes to a temporary file.  The second step simply reads the temporary file, converts it from VB to FB, and writes to a flat file. I want to merge these two sort parameters into one and only have one JCL step.

First Step:

OPTION SKIPREC=1                                                   
   SORT FIELDS=COPY                                                
 OUTREC IFTHEN=(WHEN=INIT,                                         
         PARSE=(%01=(ENDBEFR=C',',FIXLEN=08),                      
                %02=(ENDBEFR=C',',FIXLEN=09),                      
                %03=(ENDBEFR=C',',FIXLEN=02),                      
                %04=(ENDBEFR=C',',FIXLEN=10),                      
                %05=(ENDBEFR=C',',FIXLEN=05),                      
                %06=(ENDBEFR=C'  ',FIXLEN=47)),                    
         BUILD=(001:001,004,
                %01,                  
                %02,                  
                %03,                  
                %04,                  
                %05,UFF,M11,LENGTH=5,         
                %06)),                                      
  IFTHEN=(WHEN=(025,001,CH,EQ,C'/',AND,       
                027,001,CH,EQ,C'/'),                               
       OVERLAY=(028:026,006,                                       
                025:024,002,                                       
                024:C'0',                                          
                027:C'0')),                                        
  IFTHEN=(WHEN=(026,001,CH,EQ,C'/',AND,       
                028,001,CH,EQ,C'/'),                               
       OVERLAY=(024:024,003,                                       
                028:027,6,                                         
                027:C'0')),                                        
  IFTHEN=(WHEN=(025,001,CH,EQ,C'/',AND,       
                028,001,CH,EQ,C'/'),                               
       OVERLAY=(025:024,9,                                         
                024:C'0'))                                         

Second Step:

  SORT FIELDS=COPY           
OUTREC FIELDS=(1:5,80),CONVERT

I have tried putting the convert statement in several places in the first sort step, but I keep getting syntax errors. I am not posting my input data or desired output format as I already have that part working. I just want to know where in the first sort step to add the convert syntax. Can anyone help me out?

Thank you!

You need to be a member of Syncsort Community to add comments!

Join Syncsort Community

Email me when people reply –

Replies

  • Change your first OUTREC to INREC, you won't need temporary file and put your second OUTREC in the one step

    • Thank you! That worked.

This reply was deleted.

To access Syncsort Knowledge Base, visit:

My Support