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
 

 

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 Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm


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