View previous topic :: View next topic
|
Author |
Message |
mkssampathkumar Warnings : 1 New User
Joined: 31 Aug 2006 Posts: 57 Location: chennai
|
|
|
|
Hi
How to reformat the records using SORT command.
for example,
am having 2 fields(field1 and field2)
The length of both the fields are 10.
input rec :
pos: 12345678901234567890
rec: abcdefghij0987654321
output rec :
pos: 12345678901234567890
rec: 0987654321abcdefghij
I want to reformat the record like second field has to come in first position.
How to do that using SORT command.
Thanks.. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
HI there,
Use the folowing control card
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL OUTREC=(1:11,10,11:1,10)
/* |
|
|
Back to top |
|
|
mkssampathkumar Warnings : 1 New User
Joined: 31 Aug 2006 Posts: 57 Location: chennai
|
|
|
|
Hi
Thanks for ur reply.
its very useful for me.
its is only for reformatting.If i want to sort and then i have to reformat means,what shall i do??.
i want to sort by field2 and then i have to reformat using one step.
Is it possible? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Code: |
//SYSIN DD *
SORT FIELDS= (11,10,CH,A)
OUTFIL OUTREC=(1:11,10,11:1,10)
/* |
|
|
Back to top |
|
|
mkssampathkumar Warnings : 1 New User
Joined: 31 Aug 2006 Posts: 57 Location: chennai
|
|
|
|
Hi
Thanks for your reply.. |
|
Back to top |
|
|
|