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
 

 

Multiple Positioning

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 2:39 pm    Post subject: Multiple Positioning
Reply with quote

Database Structure:

A - Root Segment
B1 - 1st Level
C1 - 2nd Level(child of B1)
C2 - 2nd Level(child of B1)
B2 - 1st Level
B3 - 1st Level
There are many C1 and C2 segments under B1.
(e.g)
A
B1
C1
C1
C1
C2
C2
B1
C1
C1
C2
B2
B2
B3
B3

Requirement:
Read the C1, C2, B2 and B3. If these segments meet Condition-A perform delete and insert (cause the replace is for Key field).

Please advise for an approach (the calls and SSA's that I should prefer).

Thanks in advance,
Back to top
View user's profile Send private message

km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Mon Feb 02, 2009 4:45 pm    Post subject:
Reply with quote

Hello,
One approach -

If you have the key for 'A' & 'B1', use a Qualified SSA for A & B1 with GU call to reach B1. Once there perform GN call with no SSA until GB status to fetch all C1, C2, B2 and B3. After each call place your condition check.

Hope this helps.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 5:20 pm    Post subject:
Reply with quote

Multiple conditioning is relatively easy. You define additional PCBs within your PSB for the same database. You need to be very careful - use each defined PCB for a specific function. If you want to go this route, we will help you thru it.

Do you know as you are reading the multiple child segments if it is a candidate for "replacement" - delete and insert?
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 7:03 pm    Post subject: Reply to: Multiple Positioning
Reply with quote

How do we perform using Multiple positioning.
I may or may not have child segments - c1, c2,b2 and b3.
I need to scan the entire Database on these segments, verify for a condition, if true perform a delt & isrt.
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 7:04 pm    Post subject:
Reply with quote

There can be multiple child segments.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 7:11 pm    Post subject:
Reply with quote

Depending on which segments determine a dlet and an insrt dictates the best way to perform the logic. There can always be multiple child segments - that is the purpose of child segments. You should always perform routines based on this fact.

Can you please expand on what your requirements are?
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 7:45 pm    Post subject:
Reply with quote

On segment C1, C2, B2 and B3.
Please let me know if you require more detail
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 8:04 pm    Post subject:
Reply with quote

What determines deleting and re-inserting those segments? Do you need to replace any segments/update fields on the parents of these segments? Where are getting the new key values?
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 8:12 pm    Post subject:
Reply with quote

The child segment layout is Key1, Key2,Key3,FieldA,FieldB.
Read the child segment.
If Key 3 is found in VSAM file, delt the child segment insert a new segment with Key3 value say 'xxx'.
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 8:12 pm    Post subject:
Reply with quote

The child segment layout is Key1, Key2,Key3,FieldA,FieldB.
Read the child segment.
If Key 3 is found in VSAM file, delt the child segment insert a new segment with Key3 value say 'xxx'.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 8:25 pm    Post subject:
Reply with quote

Can we please narrow this down a bit more....

A - Root Segment
B1 - 1st Level - B2 - B3
C1 - 2nd Level(child of B1)
C2 - 2nd Level(child of B1)

You are not interested in the B2 and B3 segments at all - correct?

You are ONLY interested in deleting and re-inserting - with new key fields - child segments of B1 both C1 and C2. The CURRENT key field values are on a vsam file with the NEW key field values. You are retrieving the vsam file with the concatenated key values of B1 along with whichever child segment you are on. If you find it on the vsam file, you will replace it - if it is not on the vsam file, you continue reading your database. Is this correct?
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Feb 02, 2009 8:39 pm    Post subject:
Reply with quote

I am interested at B2 and B3 also along with C1 and C2.
The VSAM reading is perfectly correct.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 9:16 pm    Post subject:
Reply with quote

Let me ask you if you realize that any time you delete a parent segment - all children associated with that parent also get deleted? This is IMS and it is not relational. You must have specifications - can you post them. Can you post the DBD?
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 02, 2009 10:03 pm    Post subject:
Reply with quote

In addition - there is always at least 1 solution to a problem. However, without all of the facts, it could turn into a disaster. We will guide you thru a solution - give different solutions and options, but first we must know what EXACTLY you want to accomplish. Give us the business prospective - behind every technical problem, there is an end user. Tell us what they want.
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 -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Multiple parameters Csongor All Other Mainframe Topics 16 Thu Jun 09, 2016 7:54 pm
No new posts Define Alias for multiple Data sets u... sandy98669 JCL & VSAM 4 Fri May 27, 2016 1:07 pm


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