Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing leading zeroes from sequence numbers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Thu Sep 15, 2011 5:38 pm    Post subject: Removing leading zeroes from sequence numbers
Reply with quote

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
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 15, 2011 9:57 pm    Post subject: Reply to: Removing leading zeroes from sequence numbers
Reply with quote

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
Code:

ABC      1
DEF      2
ABD      3
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Fri Sep 16, 2011 11:34 am    Post subject:
Reply with quote

Thanks Skolusu.. u saved my day!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 16, 2011 7:14 pm    Post subject: Reply to: Removing leading zeroes from sequence numbers
Reply with quote

Hello,

Just curious - why does it matter to have the leading zeros removed?

How is "number" to be used?

d
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Fri Sep 16, 2011 8:02 pm    Post subject: Reply to: Removing leading zeroes from sequence numbers
Reply with quote

Quote:
Just curious - why does it matter to have the leading zeros removed?


Dick after all this time icon_eek.gif
because that' s the requirement
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 16, 2011 8:34 pm    Post subject: Reply to: Removing leading zeroes from sequence numbers
Reply with quote

Hi Enrico,

Yup, but often there is some reason for a "requirement". . . icon_wink.gif

I continue to wonder where we get the "managers" who generate such "requirements" icon_confused.gif

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
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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us