View previous topic :: View next topic
Author
Message
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Hi,
I am running below given job and got the expected results.
Code:
//SORT01 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=INPUT.FILE.ONE,
// DISP=(SHR,KEEP,KEEP)
//SORTJNF2 DD DSN=INPUT.FILE.TWO,
// DISP=(SHR,KEEP,KEEP)
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(6,6,A)
JOINKEYS FILE=F2,FIELDS=(5,6,A)
REFORMAT FIELDS=(F2:5,6,13,10,23,5)
SORT FIELDS=COPY
END
/*
//*
I would like to know how to how to get the output in the below format:
Code:
XXXXXX,TWO BLANKS,XXXXXXXXXX,TWO BLANKS,XXXXX
I tried using OUTFIL & OUTREC but job failed with "OUTREC BEYOND LRECL".
Please suggest.
Thanks.
Back to top
joseph murphy New User Joined: 24 Nov 2008Posts: 17 Location: USA
Hi,
Try this,
OUTFIL FILES=OUT,
OUTREC=(1:1,6,8:X,9:7,10,20:X,21:17,5)
Note:
REFORMAT FIELDS=(F2:5,6,13,10,23,5) for this reformat
LREC should be 25(SORTOUT file length)
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Ramsri ,
You need to mention the positions in OUTREC/INREC based on the REFORMAT record and NOT the original file. Here your reformatted LRECL is just 21 and mentioning file positions beyond that would result in error.
You should be using a Sort card like this.
Code:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(6,6,A)
JOINKEYS FILE=F2,FIELDS=(5,6,A)
REFORMAT FIELDS=(F2:5,6,13,10,23,5)
INREC FIELDS=(1,6,C',',2X,7,10,C',',2X,17,5)
SORT FIELDS=COPY
END
/*
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Wow......wonderful.....
Arun, I have made a note of what you suggested. That is very good tip to remember. Thank you very much.
Bye.
Back to top
Please enable JavaScript!