View previous topic :: View next topic
|
Author |
Message |
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
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 |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
There can be multiple child segments. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
On segment C1, C2, B2 and B3.
Please let me know if you require more detail |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
I am interested at B2 and B3 also along with C1 and C2.
The VSAM reading is perfectly correct. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
|