View previous topic :: View next topic
Author
Message
rakesh1155 New User Joined: 21 Jan 2009Posts: 84 Location: India
Hi,
I have an input file of LRECL=120 (20 key + 50 data1 + 50 data2) and two output files
(1st output file of LRECL=80 (20 byte key + 10 byte ZEROS + 50 data1) and
2nd output file of LRECL=80 (20 byte key + 10 byte ZEROS + 50 data2).
Can someone help me with the SORT commands for the same???
I know its possible using OUTREC FIELDS and OUTFIL. But, i am not able to come up with the right syntax.
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Back to top
genesis786 Active User Joined: 28 Sep 2005Posts: 210 Location: St Katherine's Dock London
try something liek this.. let us know if this helps
Code:
//STEP2 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=indsn,DISP=SHR
//O1 DD DSN=odsn1,
// DISP=(NEW,KEEP,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//O2 DD DSN=odsn2,
// DISP=(NEW,KEEP,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=O1,
BUILD=(1,20,
C'0000000000',
21,50)
OUTFIL FNAMES=O2,
BUILD=(1,20,
C'0000000000',
71,50)
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
rakesh1155,
Here's a DFSORT job that will do what you asked for. Note the use of 10C'0'. You don't need to specify DCB attributes for the output data sets - DFSORT will set them automatically.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//OUT1 DD DSN=... output file1 (FB/80)
//OUT2 DD DSN=... output file2 (FB/80)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,BUILD=(1,20,10C'0',21,50)
OUTFIL FNAMES=OUT2,BUILD=(1,20,10C'0',71,50)
/*
Back to top
rakesh1155 New User Joined: 21 Jan 2009Posts: 84 Location: India
Thanks genesis786 & Frank.
It worked perfectly as it was needed.
Back to top
Please enable JavaScript!