View previous topic :: View next topic
|
Author |
Message |
MadanVS
New User
Joined: 28 Dec 2010 Posts: 25 Location: Chennai
|
|
|
|
Hi
My input file is
123
124
125
126
211
233
My o/p file shud be
2331
2112
1263
1251
1242
1233
I am sorting my input file descending and appending sequence num till 3 and after 3 I am starting once again from 1.
Can u tell me how to do it using sort card?
By the way my i/p & o/p card lrec is 80 and FB file.
Thanks
Madhan |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
MadanVS,
Use the following DFSORT JCL which will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
123
124
125
126
211
233
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,3,CH,D),EQUALS
OUTREC IFTHEN=(WHEN=GROUP,RECORDS=3,PUSH=(4:SEQ=1))
//* |
|
|
Back to top |
|
|
MadanVS
New User
Joined: 28 Dec 2010 Posts: 25 Location: Chennai
|
|
|
|
Thanks Skolusu.
Its working good. |
|
Back to top |
|
|
|