View previous topic :: View next topic
|
Author |
Message |
naveen_amudalapelly Warnings : 1 New User
Joined: 15 Oct 2004 Posts: 16
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|