IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to reformat records using SORT command


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkssampathkumar
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 57
Location: chennai

PostPosted: Tue Feb 20, 2007 2:57 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1209
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 3:10 pm
Reply with quote

HI there,

Use the folowing control card

Code:
//SYSIN    DD  *                   
   OPTION COPY                     
   OUTFIL OUTREC=(1:11,10,11:1,10) 
                                   
/*
Back to top
View user's profile Send private message
mkssampathkumar
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 57
Location: chennai

PostPosted: Tue Feb 20, 2007 3:26 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1209
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 3:29 pm
Reply with quote

Hi There,

Code:
//SYSIN    DD  *
  SORT FIELDS= (11,10,CH,A)
  OUTFIL OUTREC=(1:11,10,11:1,10)
/*
Back to top
View user's profile Send private message
mkssampathkumar
Warnings : 1

New User


Joined: 31 Aug 2006
Posts: 57
Location: chennai

PostPosted: Tue Feb 20, 2007 4:33 pm
Reply with quote

Hi
Thanks for your reply..
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts USAGE parameter of RACDCERT CONNECT c... All Other Mainframe Topics 2
Search our Forums:


Back to Top