View previous topic :: View next topic
|
Author |
Message |
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
I was asked this question:
I have one input say: HLQ.TEMP.FILE, records in file are:
Code: |
111 $$$$$
333 CCCCC
444 EEEEE
555 GGGGG
222 AAAAA |
Using any utility in a JCL, get the outout as:
Code: |
1. 111 $$$$$
2. 333 CCCCC
3. 444 EEEEE
4. 555 GGGGG
5. 222 AAAAA |
I hope SORTs' OVERLAY or OUTFIL option can do this but I know to append the same value, I mean, can get the following out put easily using OVERLAY etc.:
Code: |
1. 111 $$$$$
1. 333 CCCCC
1. 444 EEEEE
1. 555 GGGGG
1. 222 AAAAA |
But how can I keep incrementing the appended value in column 1 of output? Please suggest. |
|
Back to top |
|
|
ranjanp
New User
Joined: 02 May 2006 Posts: 25
|
|
|
|
Use a sort card like
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(001:SEQNUM,1,ZD,002:C'.',006:001,75)
//*
SEQNUM parameter will take care of the numbering and the incrementing. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hey Thanks, I didn't think about SEQNUM verb. I am stupid enough..! |
|
Back to top |
|
|
|