kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Jun 01, 2010 10:26 am Post subject: |
|
|
oneofspace,
Use the following DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input FB 80 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,PUSH=(81:SEQ=8,1,80),
BEGIN=(1,80,SS,EQ,C'********** LIST **********'))
OUTFIL IFOUTLEN=80,
INCLUDE=(81,8,ZD,GT,0,AND,81,8,ZD,LE,4),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),
BUILD=(80C'*',/,C'STUDENTS:',/,C'---------',/,1,80)),
IFTHEN=(WHEN=(81,8,ZD,EQ,3),
BUILD=(C'EMPLOYEES:',/,C'----------',/,89,80,/,1,80)),
IFTHEN=(WHEN=(81,8,ZD,EQ,4),
BUILD=(80C' ',/,1,80,/,80C' ',/,80C'*'))
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|