IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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

Senior Member


Joined: 14 Mar 2007
Posts: 10695
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

Active Member


Joined: 29 Apr 2008
Posts: 876
Location: Maryland

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 All times are GMT + 6 Hours
Forum Index -> SYNCSORT
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Combining more 4 files with sorted or... DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... SYNCSORT 10
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... SYNCSORT 1

Back to Top