Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to reformat records using SORT command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to reformat records using SORT command
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: 1187
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 3:10 pm    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 3:29 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us