vaibhavjadhav
New User
Joined: 27 Jul 2007 Posts: 33 Location: mumbai
|
|
|
|
Hi,
Could you please help me in achieving the below output?
The input records are as given in the below structure. The input is continued into the next line, the last field starts at position 25 and continues onto the next line again at 25, and i want to sort the input based on the first field i.e. 001,002 etc. The expected output is as shwn below.
Can this functionality be implemented using ICETOOL.
Code: |
Input:
1----5----10----15----20----25----30
004 PETER AMERICA LOVES
LIFE
003 SAM UK LOVES
LIFE
001 RONALD AUSTRALIA HATES
LIFE
002 KATE AFRICA HATES
LIFE
005 WILLIAM IRELAND HATES
LIFE
Output:
1----5----10----15----20----25----30
001 RONALD AUSTRALIA HATES
LIFE
002 KATE AFRICA HATES
LIFE
003 SAM UK LOVES
LIFE
004 PETER AMERICA LOVES
LIFE
005 WILLIAM IRELAND HATES
LIFE
|
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
vaibhavjadhav,
Assuming your input is FB, LRECL=30 and the continuation line has a space in the first byte, the following DFSORT JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input FB 30 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,NE,C' '),PUSH=(31:1,3))
SORT FIELDS=(31,03,CH,A),EQUALS
OUTREC BUILD=(1,30)
//* |
|
|