shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Sun Aug 20, 2006 8:16 am Post subject: |
|
|
Ace,
I have tried using SORT with the assumption that data always starts from COL 1 but really do not know whether the solution is correct / not.Experts need to correct me for this.
Try this code:
Code: |
//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
A1B2C3
A1B(SPACE)2C3
A1B-2C3
A1B(SPACE)(SPACE)2C3
A1B(SPACE)(SPACE)(SPACE)2C3
A1B(SPACE)(SPACE)(SPACE)(SPACE)2C3
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(4,28,CH,EQ,C'(SPACE)(SPACE)(SPACE)(SPACE)',AND,
32,1,BI,EQ,1,OR,
32,1,BI,EQ,2,OR,
32,1,BI,EQ,3,OR,
32,1,BI,EQ,4,OR,
32,1,BI,EQ,5,OR,
32,1,BI,EQ,6,OR,
32,1,BI,EQ,7,OR,
32,1,BI,EQ,8,OR,
32,1,BI,EQ,9,OR,
32,1,BI,EQ,0,OR,
33,1,CH,EQ,C'A',OR,
33,1,CH,EQ,C'B',OR,
33,1,CH,EQ,C'C',OR,
33,1,CH,EQ,C'D',OR,
33,1,CH,EQ,C'E',OR,
33,1,CH,EQ,C'F',OR,
33,1,CH,EQ,C'G',OR,
33,1,CH,EQ,C'H',OR,
33,1,CH,EQ,C'I',OR,
33,1,CH,EQ,C'J',OR,
33,1,CH,EQ,C'K',OR,
33,1,CH,EQ,C'L',OR,
33,1,CH,EQ,C'M',OR,
33,1,CH,EQ,C'N',OR,
33,1,CH,EQ,C'O',OR,
33,1,CH,EQ,C'P',OR,
33,1,CH,EQ,C'Q',OR,
33,1,CH,EQ,C'R',OR,
33,1,CH,EQ,C'S',OR,
33,1,CH,EQ,C'T',OR,
33,1,CH,EQ,C'U',OR,
33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