Reset dl1 root segment pointer



IBM's hierarchical database management system with a Database Manager (IMS DB) and a Transaction Manager(IMS DC)

Reset dl1 root segment pointer

Postby mvsgal » Mon Mar 11, 2013 10:55 pm

Hi,

I need to be able to reset the DL1 pointer back to the first record of the root segment.

Does anyone know the DL1 call to use to achieve that?

Debbie
mvsgal
 
Posts: 3
Joined: Thu Jan 03, 2013 9:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reset dl1 root segment pointer

Postby NicC » Mon Mar 11, 2013 11:27 pm

If you are wanting to do what I think you are wanting to do then why not save the key when you first read the segment?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
pmartyn (Thu Mar 28, 2013 4:42 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Reset dl1 root segment pointer

Postby mvsgal » Tue Mar 12, 2013 12:36 am

Because I haven't read the first segment.

I'm running an Easytrieve program and a previous job activity has done a GU on a record that has set the pointer to somewhere within the root segment.

The current job activity then needs to walk through all the root segments starting from the beginning. I've tried doing a GU => high values, so the next GN would roll around to the first root segment, but that doesn't seem to work, because, even though the last segment is found, the first record still seems to be missed on the next GN.

Any ideas how I can effectively reset the DL1 pointer to the start of the database, so the walk through can be guaranteed to pick up the first root segment would be very much appreciated, because I'm tearing my hair out now.

Debbie
mvsgal
 
Posts: 3
Joined: Thu Jan 03, 2013 9:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reset dl1 root segment pointer

Postby BillyBoyo » Tue Mar 12, 2013 1:09 am

A previous JOB activity shouldn't affect another JOB activity. Have you got a manual?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Reset dl1 root segment pointer

Postby dick scherrer » Tue Mar 12, 2013 8:54 am

Hello and welcome to the forum,

I don't "do" ims, but what if you looked for => low values to start from the beginnng?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reset dl1 root segment pointer

Postby pmartyn » Thu Mar 28, 2013 5:19 am

If I understand your question - you want to retrieve the first occurance of a segment (in this case a parent segment) after some other processing has done something.

There is a procedure in place to let you do that. By using a Unqualified SSA on a GN call for the segment desired you will retrieve the first occurance when using it for the first time. Note: It'll always extract first occurrence of the segment.
The first use of this SSA retrieves the first occurance. The next use of this SSA will retrieve the next occurance of that segment regardless of parentage. However since you onlly want the first occurance of the highest parent you are ok. Use this SSA to retrieve the first parent and do not use it again.

For how to create a Unqualified SSA please refer to the IBM IMS V10 manual. Here is the link: http://pic.dhe.ibm.com/infocenter/dzich ... p3hqyc.htm

If this stills sounds unclear. I will provide an example but you should be ok.
pmartyn
 
Posts: 42
Joined: Thu Feb 28, 2013 7:11 pm
Has thanked: 5 times
Been thanked: 3 times

Re: Reset dl1 root segment pointer

Postby mvsgal » Thu Mar 28, 2013 4:23 pm

Hi pmartyn,

Thank you for that suggestion. I ended up doing a GU with a key of high values to position past the last record, which gives a GE. Then an unqualified GN, which gives a GB. Then another GN, which causes DL1 to revolve the pointer around to the beginning of the database and retrieve the first record.

Debbie
mvsgal
 
Posts: 3
Joined: Thu Jan 03, 2013 9:05 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IMS DB/DC

 


  • Related topics
    Replies
    Views
    Last post