kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Fri May 16, 2003 4:13 pm Post subject: |
|
|
Abhi,
The following JCL will give you the desired results.I am assuming that your input file is lrecl is 80. we add a seqnum for each record and sort on that seqnum descending.By doing so the order will be reversed. While writting the output we remove the seqnum.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
INREC FILEDS=(1,80,SEQNUM,8,ZD) $ TOTAL LRECL + SEQNUM
SORT FIELDS=(81,8,ZD,D) $ SORT ON SEQNUM DESC
OUTREC FIELDS=(1,80) $ STRIP THE SEQNUM
/*
|
Hope this helps...
cheers
kolusu |
|