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

Adding Sequence number


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


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 Generate random number from range of ... COBOL Programming 3
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top