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
 

 

Adding a nine digit sequential counter to each record

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

New User


Joined: 15 Oct 2004
Posts: 16

PostPosted: Fri Feb 16, 2007 3:09 am    Post subject: Adding a nine digit sequential counter to each record
Reply with quote

Hi,

I have one dataset which consist of 1000 records(ID, NAME), now i would like to add a nine digit sequential counter to each record

say ex: output file
id name sequential counter
1 Naveen 000000001
2 Naveen1 000000002
3 Naveen2 00000003 etc....
: :
: :
1000 Naveen1000 000001000

Cany one please advice jcl
I appreciate your all your help
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 16, 2007 3:21 am    Post subject:
Reply with quote

Standard responce:
Which sort do you have?
Have you looked at the manual?
What you want is quite simple, Use sort copy and outrec to add an additional field for the sequence number.
If I were you, I'd start here: DFSORT/ICETOOL Reference Material
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: Fri Feb 16, 2007 4:18 am    Post subject:
Reply with quote

Naveen,

Here's a DFSORT job that will do what you asked for. Just change c to the starting position you want for the sequence number:

Code:

//S1 EXEC PGM=ICEMAN                     
//SYSOUT    DD SYSOUT=*                 
//SORTIN DD DSN=...  input file     
//SORTOUT  DD DSN=...  output file             
//SYSIN     DD *                         
  OPTION COPY                           
  INREC OVERLAY=(c:SEQNUM,9,ZD)         
/*                                       
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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