Page 1 of 1

Reset dl1 root segment pointer

PostPosted: Mon Mar 11, 2013 10:55 pm
by mvsgal
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

Re: Reset dl1 root segment pointer

PostPosted: Mon Mar 11, 2013 11:27 pm
by NicC
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?

Re: Reset dl1 root segment pointer

PostPosted: Tue Mar 12, 2013 12:36 am
by mvsgal
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

Re: Reset dl1 root segment pointer

PostPosted: Tue Mar 12, 2013 1:09 am
by BillyBoyo
A previous JOB activity shouldn't affect another JOB activity. Have you got a manual?

Re: Reset dl1 root segment pointer

PostPosted: Tue Mar 12, 2013 8:54 am
by dick scherrer
Hello and welcome to the forum,

I don't "do" ims, but what if you looked for => low values to start from the beginnng?

Re: Reset dl1 root segment pointer

PostPosted: Thu Mar 28, 2013 5:19 am
by pmartyn
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.

Re: Reset dl1 root segment pointer

PostPosted: Thu Mar 28, 2013 4:23 pm
by mvsgal
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