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

Multiple Positioning


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top