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

Adding a nine digit sequential counter to each record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 16, 2007 3:21 am
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 Developer


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

PostPosted: Fri Feb 16, 2007 4:18 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top