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
 

 

Sort for inserting sequence number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Mon Jan 07, 2008 9:45 pm    Post subject: Sort for inserting sequence number
Reply with quote

Can anyone tell me how to write a sort job to insert a sequence number in the Input file in first three positions and your name in the 20th Position.

Sharad Srivastava
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 07, 2008 10:27 pm    Post subject:
Reply with quote

Sharad,

Please show an example of the records in your input file and what you expect for the output records.

Give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Tue Jan 08, 2008 3:17 am    Post subject:
Reply with quote

Try this:

Code:
//SRT80301 EXEC PGM=SORT                                           
//*                                                                 
//SYSOUT   DD SYSOUT=*                                             
//SYSPRINT DD SYSOUT=*                                             
//*                                                                 
//SORTIN   DD DSN=YOUR.INPUT.FILE,DISP=SHR                         
//SORTOUT  DD DSN=YOUR.OUTPUT.FILE,                                 
//         DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE),         
//         DCB=*.SORTIN                                             
//*                                                                 
//SYSIN    DD *                                                     
  OUTREC FIELDS=(1:SEQNUM,3,ZD,                                     
                 4:4,16,                                           
                 20:C'your name')                                   
  SORT FIELDS=COPY                                                 
/*                                                             


I have considered "your name" as the last field in your file and have fixed length.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 08, 2008 3:49 am    Post subject:
Reply with quote

Ganesh,

You are overlaying the first three bytes of the record with the sequence number. How do you know that's what the OP wanted? Given that the OP said "insert", I'd assume that the OP doesn't want to overlay the data. But it's not clear exactly what the OP does want. That's why I asked for an example of input and output to clarify what's wanted.

Please don't take wild guesses without explaining your assumptions as it just confuses people.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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