sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Wed Mar 11, 2009 12:58 pm Post subject: Sort only few records |
|
|
I have a requirement like this , i want to just want to sort only two records from sequence
i/p file(FB & 80 lrecl)
0 --- header
1
2
3
1
2
3
1
2
3
9 ---- trailer
o/p should be
0
1
3
2
1
3
2
1
3
2
9
Thanks,
Siva |
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Mar 11, 2009 1:12 pm Post subject: |
|
|
sivafdms,
You can very easily reorder the specific records using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
0 --- HEADER
1
2
3
1
2
3
1
2
3
9 ---- TRAILER
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
SORT FIELDS=(81,16,CH,A)
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),
PUSH=(81:ID=8,SEQ=8)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),
OVERLAY=(89:89,8,ZD,ADD,+1,M11,LENGTH=8)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),
OVERLAY=(89:89,8,ZD,SUB,+1,M11,LENGTH=8))
OUTREC BUILD=(1,80)
/* |
If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/ _________________ Kolusu
www.linkedin.com/in/kolusu |
|