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

Repositioning to first record


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

New User


Joined: 19 Feb 2005
Posts: 27
Location: hyderabad-ap-india

PostPosted: Wed Sep 19, 2007 2:44 pm
Reply with quote

Hi,
I have a requirement like this.
Req: When an input is received from the screen, then search if the key is present in the database. If it is not then display a screen with all the records present in the database.

Currently I am handling in the following way:

111-db-check
----------------

call CBLTDLI USING Gu, PCB,IO,Qual SSA

If Status-code is GE
perform 112-Get-all
end-if

EXIT

112-Get-all
---------------

Perform 113-get-next until status code= GE (but as the status code is already GE from the previous para, i am not able to go into 113 at all. Hence somewhere before calling this para I have to reset to the first record. But my requirement is I have to read all the records in only 113-get-next section without losing the first record. Hence can I move Spaces to STATUS-CODE exlicitely??)
'
'
'
'


Exit

113-get-next
---------------

CALl CBLTDLI using GN bla bla Unqual SSA.

store the records in an array and increment the counter for number of records, save in spa..bla bla.


So kindly help me
1. Can I move SPACE to STATUS-CODE field explicitely to get into that para?
2. Or is there anyway to reposition the pointer to the top of the database?
Please note that i should not lose a single record and counter should be accumulated only at one place.

Thanks,
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Sep 19, 2007 2:52 pm
Reply with quote

Use an unqualified GU and you will get the first rootsegment.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Sep 19, 2007 6:59 pm
Reply with quote

In addition to what George told you, I am adding my comments.....

1. Can I move SPACE to STATUS-CODE field explicitely to get into that para? NEVER-EVER move anything to the keyfeedback area - that belongs to IMS. IMS is always positional.

"Perform 113-get-next until status code= GE" You need to check for GB - end of database.

"If it is not then display a screen with all the records present in the database. "

How big is this database anyway? What you need to do is plan for putting out multiple screens.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Sep 19, 2007 7:10 pm
Reply with quote

One more thing....

"If it is not then display a screen with all the records present in the database." Why? Sometimes people request things and really don't consider the implications. Perhaps, you could suggest that they ask for a range of keys? Think about a database with perhaps a million keys?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Sep 20, 2007 12:29 am
Reply with quote

Uhm Sandy..........do you agree my answer for positioning at the 'top' of the database will do? Moving any information to the PCB-fields after one or many calls is useless; IMS will overwrite it after the next call. It won't do any harm to IMS but IMS will ignore whatever you store in the PCB and just fill it with the results it found; status-code, key feed back area and the lot of it. So, the part of positioning I take seriously but the part about changing the content of the PCB makes me smile icon_wink.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: Thu Sep 20, 2007 12:46 am
Reply with quote

I am glad I made you smile, George! icon_surprised.gif I agree, but to position at the beginning of the database, you do not even code an ssa - just a gu. The PCB interrogation should be part of every IMS newbie training. Just like the keyfeedback area. Just like the level area - and the status code. Maybe there should be a "sticky" (and it took me a while to understand what a "sticky" was) explaining how. I will help if you want. The other thing I thought about was a "sticky" for working storage for MFS attribute bytes. I can do that. Sometimes IMS manuals are very difficult to understand - especially if you are so new that you have no idea what question to even ask. icon_eek.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Sep 20, 2007 1:17 am
Reply with quote

I just went downstairs for a cup of coffee and wondered if a discussion corner (sticky) might be of help; even took the descision to PM you. Now, reading your post I don't need to PM you. The sticky is on it's way. It should not cover all about IMS so you are invited to be the first to add points in it. I propose items like:

    storing intermediate results techniques (SPA or whatever)
    positioning (and remaining) in the databases (including command codes)
    data- and processanalysis (including SI and bi-directional pointers)
    funny stuff like formerly made mistakes icon_wink.gif




In one minute it will be there......Hope you will participate in this sticky and in fact, counting on it icon_lol.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: Thu Sep 20, 2007 1:30 am
Reply with quote

Well, George, THANKYOU! Experience is worth a million IBM manuals - (no offense) sometimes too difficult for a lot of people to understand unless they have a background and even then - difficult. I will be more than happy to contribute ANYTHING that will help - been there and been lost. icon_biggrin.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Sep 20, 2007 1:36 am
Reply with quote

Hmmm Sandy, I've been in IMS since 1973 so I have got the guts to say I'm experienced icon_wink.gif BTW: the sticky is operational. You are invited to be the first to make a donation icon_lol.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top