Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Adding Sequence number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sijayapal

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Wed Oct 07, 2009 2:56 pm    Post subject: Adding Sequence number
Reply with quote

Here is my requirement.

I have a file of length 756. We have to consider only 3rd column and 751,3 for squence number genereation.
The requirement is when the 751,3 value changes, the conter should be reset. And with in the same values of the 751,3.. only when the 3rd column has 'A' the counter should be incremented. Else the value should remain same.

The seq number is added at 4,8

icon_idea.gif I already arrived at a solution... but i am not clear

SORT FIELDS=(751,3,A,12,10,A),FORMAT=CH
OUTREC IFTHEN=(WHEN=(3,1,CH,EQ,C'A'),
OVERLAY=(4:SEQNUM,8,ZD,START=1,INCR=1,RESTART=(751,3))),
IFTHEN=(WHEN=(3,1,CH,EQ,C'B'),
OVERLAY=(4:SEQNUM,8,ZD,START=1,INCR=1,RESTART=(751,3)))

Here looking into the input file i arrived no values are populated at 3rd position except A and B. But this wont work if some other value comes at 3rd Position.

I need to keep this more generic. Pls help me with your suggestions.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Oct 07, 2009 3:15 pm    Post subject:
Reply with quote

Can you please show us sample input records (relevent fields) and expected output records.(Please use code tag)
Also which sort product are you using?
Back to top
View user's profile Send private message
sijayapal

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Wed Oct 07, 2009 5:18 pm    Post subject:
Reply with quote

I CANT SHOW ALL THE 756 FIELS.. i am just showing the fields involved by an X at the top and C indicates the sequence number

Input:
Code:

  XCCCCCCCC  XXX
GAA00000000  FAK2A1
GAB00000000  FAK2A1
GAA00000000  FAK2A1
GAB00000000  FAK2A1
GAA00000000  FAK2A1
GAB00000000  FAK2A1
GAA00000000  FAK2A1
GAB00000000  NWE2A1
GAA00000000  NWE2A1
GAB00000000  NWE2A1
GAA00000000  NWE2A1
GAB00000000  NWE2A1

Output
Code:
GAA00000001  FAK2A1
GAB00000001  FAK2A1
GAA00000002  FAK2A1
GAB00000002  FAK2A1
GAA00000003  FAK2A1
GAB00000003  FAK2A1
GAA00000004  FAK2A1
GAB00000004  FAK2A1
GAA00000001  NWE2A1
GAB00000001  NWE2A1
GAA00000002  NWE2A1
GAB00000002  NWE2A1
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Oct 07, 2009 6:17 pm    Post subject:
Reply with quote

Does sequence of records in output matters?
Back to top
View user's profile Send private message
sijayapal

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Thu Oct 08, 2009 7:59 am    Post subject:
Reply with quote

IT DOESNT MATTER. oNLY THING MATTERS IS THE ONE MARKED BY X, XXX.
When XXX value changes, the counter should be restarted. When X=A, The counter should be incremented.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts Detect break in the sequence tuxama DFSORT/ICETOOL 6 Tue Mar 20, 2018 1:35 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us