View previous topic :: View next topic
|
Author |
Message |
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
I am currently attaching sequence numbers to all the records in the file using the sort card
Code: |
SORT FIELDS=COPY
OUTREC OVERLAY=(1:1,3,6:SEQNUM,5,ZD) |
Its getting displayed as
Code: |
MEMBER SEQ NUMBER
ABC 00001
DEF 00002
ABD 00003
. .
. .
. .
. .
ZZZ 09999 |
However I do not want to have the leading zeroes in the sequence numbers. How should the card be modified so that it will appear as below
Code: |
MEMBER SEQ NUMBER
ABC 1
DEF 2
ABC 3
. .
. .
. .
. .
ZZZ 9999 |
Please Help |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
seahawk789,
Use FS format for sequence number which will suppress the leading zeroes.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
DEF
ABD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(6:SEQNUM,5,FS)
/* |
will produce
|
|
Back to top |
|
|
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
Thanks Skolusu.. u saved my day! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Just curious - why does it matter to have the leading zeros removed?
How is "number" to be used?
d |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Just curious - why does it matter to have the leading zeros removed? |
Dick after all this time
because that' s the requirement |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Enrico,
Yup, but often there is some reason for a "requirement". . .
I continue to wonder where we get the "managers" who generate such "requirements"
And while we're still at it - i suspect the number with the leading zeros would be more usable / portable . . . Especially if it is to be used as input to another mainframe process. . .
d |
|
Back to top |
|
|
|