View previous topic :: View next topic
|
Author |
Message |
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Hi,
Can any one help me on how to acheive the following using SORT in a single step?
INPUT file:
123 456 789
012 345 678
OUTPUT:
123
456
789
012
345
678
Appretiate your help!
Thanks
Mallik |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Look at the ICETOOL operator RESIZE. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
1.What is your input file length?
2.How many fields does 1 record contain (atmost)?
3.Will all the fields be filled always?
4.Is the field delimiter space?
5.What is your sort product ? |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Thank you Bill and Pandora for quick reply.
Please find the details asked below:
1.What is your input file length?
14 characters
2.How many fields does 1 record contain (atmost)?
3 fields. Each field is 4 characters length.
3.Will all the fields be filled always?
Yes
4.Is the field delimiter space?
Yes
5.What is your sort product ?
Syncsort
Thanks,
Mallik |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
here is a snippet that might help,
Code: |
****** ***************************** Top of Data ******************************
- - - - - - - - - - - - - - - - - - - 2 Line(s) not Displayed
000003 //*
000004 //ICE EXEC PGM=SORT
000005 //SYSPRINT DD SYSOUT=*
000006 //SYSOUT DD SYSOUT=*
000007 //SORTIN DD *
000008 123 456 789
000009 012 345 678
000010 //SORTOUT DD SYSOUT=*
000011 //SYSIN DD *
000012 OPTION COPY
000013 OUTFIL BUILD=(1,3,/,5,3,/,9,3)
000014 //*
****** **************************** Bottom of Data **************************** |
modify according to Your need,
You might want to consider also the RESIZE control statement |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Thank you enrico.
your sample code worked for me.
Thanks,
Mallik |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
2.How many fields does 1 record contain (atmost)?
3 fields. Each field is 4 characters length |
You will have to be cautious when length becomes 4 for any of your field upon using the above sort card. |
|
Back to top |
|
|
|