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

IDMS traversing


IBM Mainframe Forums -> IDMS/ADSO
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Neeraj Kumar Mishra

New User


Joined: 18 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Fri Sep 19, 2008 10:27 am
Reply with quote

Hi ,

I have one query,

i have schema and subschema say arsc0002 and arss0000.
there are two records ar2605-claimkey and ar2606-claimid
i have to walk the idms records for this i have to read first 2605 , if some field = x(say) then only i have to process else i have to read next record.
now,
i have to read 1-many 2606 per existing value(from 2605) and accumulate some fields until rc=0309(for 2606) for this,
i have to fetch one record occurence of 2605 and i have to do some calculation on records related to record occurence fetched (from 2605) until i got out of record of 2605.
i am not reading any file , i am just accessing database and creating a output file.

it is some thing like(as i understood , since i am from ' c ' background ) a nested loop say for(i=0;i<10;i++)
{
for(j=0;j<=10;j++)
{ do something;
}
}
i could be record 2605 and j could be 2606.
i am new in idms i am not able to figure out how will i do this, please help.

Thanks in advance.
Back to top
View user's profile Send private message
P. Vijaya Kumar

New User


Joined: 19 Sep 2008
Posts: 1
Location: Kerala

PostPosted: Sat Sep 20, 2008 11:28 am
Reply with quote

Neeraj
The following information might help.

IDMS is a networked database. What one needs to keep in mind is that there are hard links to location of records in a database which the dbms keeps track of. This not as critical in reading a record as in creating one. On the other hand, in a well designed database, the speed is phenomenal as compared to an equivalent relational db, especially when db sizes are huge.

IDMS records are organised as sets which are groups of records with an owner record. Each set has one owner and 0-many members. The owners and members cannot be of the same record type for a given set.

In the case you have cited, What one needs to know now is how a single record is accessed in a database (usually an owner record you are interested in) and how its members are then traversed.

You also need to know the syntax in the language you are using to do all this - for our purpose I will assume cobol (afterall this is a mainframe site...;-)

Historically idms db's are represented as bachmann diagrams. (you can look this up). I assume you have one for the db you are interested in.

What ever that might be, the first thing you would do is to find your first 2605 record. The syntax in cobol is OBTAIN <record name> <keyname> (this is the basic skeleton). Assumption here is that there is a key on 2605. If you are lucky, all the 2605's that you are interested in might be the member of a set - in which case you can start with the owner of that set. Your schema will tell you that.

Having done that you need to know where your 2606 is. Now here is the critical bit. YOU NEED TO KNOW WHICH SET TO USE -the name of set- within which the 2606 is to be found. Again the schema tells you this.

Once you have that, you can do an OBTAIN first <2606> within that set.

The set can then be traversed sequentially with OBTAIN NEXT <2606> within the set.

In each of these you specify an AT END to check for the end and do the end of set processing.

Once you have reached the end of set for the set owned by the first 2605, then you can find the next 2605 and find all 2606's under it.

You would then repeat this till you have exhausted all your 2605's.

This is a quick and dirty answer. There are a whole lot of associated COBOL declaration required etc. I have not said anything that you would not find in any IDMS primer. It might be worth spending some time reading it...;-)

All the best.
Back to top
View user's profile Send private message
Neeraj Kumar Mishra

New User


Joined: 18 Sep 2008
Posts: 6
Location: Bangalore

PostPosted: Tue Sep 23, 2008 11:17 am
Reply with quote

Vijay,

Thanks for the reply, but the problem was that i had to obtain the calc field from the database itself, let me make more clear.
The ar2605 was containing the calc field as a group field, i had to obtain from there and based upon that i had to walk in 2606.
since i was not reading from any file (the calc) i was unable to walk in 2605 itself.
I got the solution by walking the the set through area sweep and i came to know in this situation we have to do area sweep , now the code
OBTAIN FIRST AR2605-CLAIMKEY WITHIN ARA003-CLDTL-REG.
is working where ARA003-CLDTL-REG is area name. and in that way i am able to do walk without calc field.
Thanks a lot
Neeraj
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 -> IDMS/ADSO

 


Similar Topics
Topic Forum Replies
No new posts IDMS record copybook IDMS/ADSO 3
No new posts Can records in IMS/DB be related usin... IMS DB/DC 2
No new posts IDMS DC027007 T58 TASK:ADS2 PROG:ADSO... IDMS/ADSO 2
No new posts IDMS/DC-COBOL program - SNAP error wh... IDMS/ADSO 5
No new posts ADS 3270 Batch simulator for IDMS rel... IDMS/ADSO 1
Search our Forums:

Back to Top