|
|
| Author |
Message |
raveendra_ibm Currently Banned New User
Joined: 07 Jan 2006 Posts: 45
|
|
|
|
Hi All,
I am new to IMS - DB.
Could anyone please give me a cobol sample code to insert a record at the 3rd level of a IMS database segment, assuming any simple schema and explain the same.
Thanks and Regards,
Raveendra. |
|
| Back to top |
|
 |
References
|
|
 |
Bitneuker
IMS Moderator
Joined: 07 Nov 2005 Posts: 1140 Location: The Netherlands at Hole 19
|
|
|
|
Hi Raveendra,
If you're new to IMS I advise you to read the manual(s). There's a lot to know about IMS so teaching and training in this forum would take too much time and effort. As for your question I'll answer it this time. Like in all data management systems you first position where you want to add data. In this case (IMS) it's a hierarchy so you will have to position. I'll give you two ways to do it.
If segments 1 (root) and 2 (parent) are present and the keys are known. You issue 2 SSA's in your GU-call to establish position.
CALL CBLTDLI USING GU, DB-PCB,IO-AREA,SSA-ROOT(KEY=),SSA-PARENT(KEY=).
Then you just perform the ISRT-call:
CALL CBLTDLI USING ISRT, DB-PBC, IO-AREA, SSA-CHILD.
If root and parent are not present you may insert them too in a pathcall. Your IO-area should contain all data and the first SSA should contain the command code *D. This will insert the complete sequence. From the manual I copied this for you. Do some further investigation yourself please.
1.1.8.1.2.2 Inserting a Sequence of Segments
With ISRT calls, you can use the D command code to insert a path of segments at once. When you are using D with ISRT, you do not have to include D for each SSA in the path. You just specify D on the first segment that you want IMS to insert. IMS inserts the segments in the path that follow.
For example, suppose you had the following request:
Judy Jennison visited the clinic for the first time. Add a record
that includes PATIENT, ILLNESS, and TREATMNT segments.
After building the segments in your I/O area, issue an ISRT call with the following SSAs:
ISRT PATIENTb*Db
ILLNESSbb
TREATMNTb
Not only is the PATIENT segment added, but the segments following the PATIENT segment, ILLNESS and TREATMNT, are added to the database.
Cheers, |
|
| Back to top |
|
 |
Bitneuker
IMS Moderator
Joined: 07 Nov 2005 Posts: 1140 Location: The Netherlands at Hole 19
|
|
|
|
| By the way: I consulted this manual: IMS/ESA V4 Application Programming DL/I Calls |
|
| Back to top |
|
 |
harshavmr Currently Banned New User
Joined: 10 Jun 2005 Posts: 5 Location: Hyderabad
|
|
|
|
| george can you give any URL which gives the complete explination of this |
|
| Back to top |
|
 |
Bitneuker
IMS Moderator
Joined: 07 Nov 2005 Posts: 1140 Location: The Netherlands at Hole 19
|
|
| Back to top |
|
 |
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 130 Location: Tadepalligudem
|
|
|
|
click here
Corrections welcomed.........
Thanks,
Rajesh |
|
| Back to top |
|
 |
Bitneuker
IMS Moderator
Joined: 07 Nov 2005 Posts: 1140 Location: The Netherlands at Hole 19
|
|
|
|
Hi Rajesh,
Could you explain what you mean with the post? The latest answer to this topic was given about a month ago and no further requirements have been posted since. What brings you to re-open the topic? |
|
| Back to top |
|
 |
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 130 Location: Tadepalligudem
|
|
|
|
ooooooooppppps.....sorry I thought it is updation.sorry for that
Thanks,
Rajesh |
|
| Back to top |
|
 |
|
|