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
 

 

Mass Insert in IMS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: Mass Insert in IMS
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    Post subject:
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    Post subject: Reply to: Mass Insert in IMS
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    Post subject:
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    Post subject: Reply to: Mass Insert in IMS
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    Post subject:
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    Post subject: Reply to: Mass Insert in IMS
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Mass Insert in IMS
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    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 Mass comment and edit elixir1986 IBM Tools 3 Thu Mar 02, 2017 10:09 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts How do I right justify a string in an... rakesh17684 DB2 1 Wed Jun 08, 2016 8:01 pm
No new posts insert the same records but chancing ... danylele74 DB2 6 Mon May 02, 2016 7:22 pm


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