View previous topic :: View next topic
|
Author |
Message |
Geetha B
New User
Joined: 24 Nov 2007 Posts: 12 Location: chennai
|
|
|
|
Hi,
I have a req to insert records in the 3rd level of ims segment
ex if a is the root segment b is the 2nd level segment and c is the 3rd level segment.
the path is
a--b--c
I need to insert values into c segment,the number of values i need to insert roughly comes around 586.
Is there any facility to do mass insert with one dl/I call,cause currently we are doing individual insert in a loop,so there are roughly 586 separate dl/i calls being processed within the loop.
I use qualified SSA's for a and b segment and unqualified SSA for the c segment,to do the insert
Thanks,
Geetha |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
[I need to insert values into c segment,the number of values i need to insert roughly comes around 586.]
Are you inserting new segments or replacing existing segments? |
|
Back to top |
|
|
Geetha B
New User
Joined: 24 Nov 2007 Posts: 12 Location: chennai
|
|
|
|
Iam inserting new values for the existing child segment |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
You are then REPACING existing segments not inserting new ones. So for each C segment you are updating, you first need to get hold it and then replace it. How are you loading the key values into the SSA for segments A and B? |
|
Back to top |
|
|
Geetha B
New User
Joined: 24 Nov 2007 Posts: 12 Location: chennai
|
|
|
|
I think there had been a minor confusion in the way i stated the req.
I actually need to insert new occurence of the child segment C
The structure is
A
- B
- C
- C
- C
.
.
- C
ie currently for parent A with value 'abc' and child B with value '5386' i need to insert value for C segment as '101 abc'
similarly for the same parent A with value 'abc' and same child B with value '5386' i need to insert value for C segment as '102 abc'
Similarly for the same parent A with value 'abc' and same child B with value '5386' i need to insert value for C segment as '103 abc'
Iam not modifying any existing C segment values for that particular path (A with value 'abc' and B with value '5386)
Iam inserting all the C segment for that particular path (A with value 'abc' and B with value '5386) |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
I am still confused about what you are doing. But, if you are indeed INSERTING a new C segment, and you know the key values for the segments A and B, you can do a path insert for the NEW sement C. You will load the key values into the qualified SSA fields for both A and B segments and use an unqualifed SSA for C segment. Build your C segment and then issue a path ISRT. Make sure that you check your status code. If you get spaces, great. If you get II, then that C segment already exists. If you get status code GE, then IMS could not resolve the key values in either A or B segments - in other words, they don't exist. Check your segment level field in your PCB to see how far IMS got. If the segment level is 1, then it is the root, 2 is the B segment. |
|
Back to top |
|
|
Geetha B
New User
Joined: 24 Nov 2007 Posts: 12 Location: chennai
|
|
|
|
Thanks Sandy for the detailed explanation.
I did actually do a insert in the way you had specified,but u see i need to insert 586 diff occurence of the c segment.
According to the current code
We make a qualified call for A and B segment and pass a unqulified ssa for the C segement.We do populate the values needed for the C segement record by reading the input file
Pseudo Code
move 'abc' to a record key
move '5386 to b record key
perfom until end of input file
read i/p file
move values to c record
insert using qualified ssa for a and b and unqualified ssa for c
end-perform
as u can see from the above code the insert dl/i call is executed for all the record in the i/p file,we just want to avoid looping the insert,and insert all the 586 occurence in one dl/i call
is there a way to insert all the 586 occurence of the c segement in one dl/i call
The total records which would be in the i/p file is 586
hope iam clear in my req |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
OK - we're getting there!!!! There is no way to insert 586 segments with one call. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Something else to consider. Make sure that your input file is sorted in the key sequence for segment C. It will ensure that your process runs as quickly as possible. |
|
Back to top |
|
|
Geetha B
New User
Joined: 24 Nov 2007 Posts: 12 Location: chennai
|
|
|
|
Thanks Sandy |
|
Back to top |
|
|
|