kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Oct 12, 2010 2:57 pm Post subject: |
|
|
nishantrk,
The following DFSORT JCL will give you the desired results. I assumed that your account number starts at position 11 for a length of 9 bytes.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
BEGIN 222222222
80101 ADD
80102 XXXXXXXXXXXXXXXXXXXXXXXXXX
80103 XXXXXXXXXXXXXXXXXXXXXXXXXX
80104 XXXXXXXXXXXXXRSXXXXXXXXXXXXX
BEGIN 333333333
80101 CHG
80102 XXXXXXXXXXXXXXXXXXXXXXXXXX
80103 XXXXXXXXXXXXXXXXXXXXXXXXXX
80104 XXXXXXXXXXXXXRSXXXXXXXXXXXXX
BEGIN 444444444
80101 ADD
80102 XXXXXXXXXXXXXXXXXXXXXXXXXX
80103 XXXXXXXXXXXXXXXXXXXXXXXXXX
BEGIN 555555555
80101 ADD
80102 XXXXXXXXXXXXXRSXXXXXXXXXXXXX
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'BEGIN'),PUSH=(81:11,9)),
IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'80101'),PUSH=(90:7,3),
END=(1,5,CH,EQ,C'BEGIN'))
OUTFIL BUILD=(C'BEGIN',11:81,9,80:X),
INCLUDE=(45,2,CH,EQ,C'RS',AND,90,3,CH,EQ,C'ADD')
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|