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

Sequence number add in SORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Fri Sep 02, 2016 3:32 pm
Reply with quote

I am using below code to increase sequence number every time job runs.

Code:

SORT FIELDS=COPY                                     
OUTREC FIELDS=(1:1,24,25:&DATE1,33:C'|SEQNO=',       
             40:40,6,ZD,ADD,+1,TO=ZD,LENGTH=6,46:122X)


My Input:
Code:

H|Feeder=upstreams|Date=20160902|SEQNO=000001


I am getting output as below.
Code:

H|Feeder=upstreams|Date=20160902|SEQNO=00000B


I am expecting
Code:

H|Feeder=upstreams|Date=20160902|SEQNO=000002


What am I missing?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Sep 02, 2016 3:53 pm
Reply with quote

Quote:
What am I missing?

the understanding of the ZD representation
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Fri Sep 02, 2016 4:05 pm
Reply with quote

Thanks Enrico. You are right.

Changed as below and it worked.

Code:

TO=ZDF
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Sat Sep 03, 2016 11:18 pm
Reply with quote

More clear and more flexible would be using the parameter EDIT:
Code:
....,ADD,+1,EDIT=(TTTTTT),....
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top