Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us