Page 1 of 1

Copy Using SYNCSORT

PostPosted: Wed Aug 11, 2010 12:22 pm
by Bhairnr
Hi All
I have below requirement
Can anybody help me in this regards

I have to copy data from input file position 5 length 15
to output file position 9 length 15 and
moves 0000 to output file position 5 length 4
and copy data from 24 position in input file unchanged
to output file

Note :- Header and trailer should be copy
as they are in input file and can be recognized
by first character 'H' or 'T'

Thanks
Bhairon

Re: Copy Using SYNCSORT

PostPosted: Wed Aug 11, 2010 11:47 pm
by dick scherrer
Hello and welcome to the forum,

Post some sample input data and the output you want from that input.

Mention the recfm and lrecl of the files.

Describe any other processing rules you want used processing the input to the output.

Re: Copy Using SYNCSORT

PostPosted: Wed Aug 18, 2010 8:25 pm
by Alissa Margulies
Here is an example that may help you.
//SORT1 EXEC PGM=SORT                         
//SORTIN  DD *                                 
H                                             
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ           
T                                             
//SORTOUT DD SYSOUT=*                         
//SYSOUT  DD SYSOUT=*                           
//SYSIN   DD *                                   
  INREC IFTHEN=(WHEN=(1,1,CH,NE,L(C'H',C'T')),
    BUILD=(5:C'0000',9:5,15,24:24,1))         
  SORT FIELDS=COPY   
/*                         

The output produced by the step above is as follows:
H                       
    0000456789ABCDEFGHIN
T                       

If these are not your requirements, then please provide all the information that Dick had previously requested so that we can better assist you.

Regards,