kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Fri Jun 23, 2006 9:06 am Post subject: |
|
|
sreenivask,
Try this job.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
0007 A 1
0007 A 1
0007 B 2
0007 B 2
0007 B 1
0007 B 1
0007 C 1
0008 A 1
0008 B 2
0008 B 2
0008 B 2
0008 B 2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,4,CH,A,
6,1,CH,A)
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(41:SEQNUM,8,ZD,RESTART=(1,4))),
IFTHEN=(WHEN=(8,1,CH,EQ,C'1'),
OVERLAY=(49:C'00000001',
57:C'00000000')),
IFTHEN=(WHEN=(8,1,CH,EQ,C'2'),
OVERLAY=(49:C'00000000',
57:C'00000001'))
SUM FIELDS=(49,8,ZD,
57,8,ZD)
OUTREC IFTHEN=(WHEN=(41,8,ZD,GT,1),
OVERLAY=(01:4X),HIT=NEXT),
IFTHEN=(WHEN=(8,1,CH,EQ,C'2'),
OVERLAY=(57:57,8,ZD,DIV,+2,M11,LENGTH=8))
OUTFIL OUTREC=(1,7,
49,8,ZD,ADD,57,8,ZD,M10,LENGTH=8,
80:X)
/*
|
Hope this helps....
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|