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
 

 

Sequence number add in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 70
Location: India

PostPosted: Fri Sep 02, 2016 3:32 pm    Post subject: Sequence number add in SORT
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Sep 02, 2016 3:53 pm    Post subject: Reply to: Sequence number add in SORT
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: 70
Location: India

PostPosted: Fri Sep 02, 2016 4:05 pm    Post subject:
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

New User


Joined: 29 Apr 2008
Posts: 71
Location: Maryland

PostPosted: Sat Sep 03, 2016 11:18 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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