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

Mass Insert in IMS


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Geetha B

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Mon Jul 21, 2008 12:22 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Mon Jul 21, 2008 3:37 pm
Reply with quote

[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
View user's profile Send private message
Geetha B

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Mon Jul 21, 2008 3:51 pm
Reply with quote

Iam inserting new values for the existing child segment
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 Jul 21, 2008 4:05 pm
Reply with quote

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
View user's profile Send private message
Geetha B

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Mon Jul 21, 2008 4:19 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Mon Jul 21, 2008 4:48 pm
Reply with quote

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
View user's profile Send private message
Geetha B

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Mon Jul 21, 2008 5:06 pm
Reply with quote

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 icon_redface.gif
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 Jul 21, 2008 5:56 pm
Reply with quote

OK - we're getting there!!!! There is no way to insert 586 segments with one call.
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 Jul 21, 2008 7:25 pm
Reply with quote

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
View user's profile Send private message
Geetha B

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Tue Jul 22, 2008 8:45 am
Reply with quote

Thanks Sandy
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 Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Identify Program Insert DB2 7
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top