Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in


IDMS traversing

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IDMS/ADSO
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    Post subject: IDMS traversing
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.
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++)
{ 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    Post subject:
Reply with quote

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    Post subject: Thanks Vijay
Reply with quote


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
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
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IDMS/ADSO All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDMS/DC-COBOL program - SNAP error wh... rakeshsekar1987 IDMS/ADSO 5 Tue Sep 13, 2016 8:28 pm
No new posts ADS 3270 Batch simulator for IDMS rel... gpowell382 IDMS/ADSO 1 Thu May 05, 2016 8:02 pm
No new posts ALTER of an IDMS AREA with NEW/OLD pa... Awanti IDMS/ADSO 2 Mon Mar 14, 2016 10:01 pm
This topic is locked: you cannot edit posts or make replies. Sticky: CA IDMS v18.5 Manuals Pandora-Box IDMS/ADSO 0 Sun Dec 13, 2015 5:37 pm
No new posts Need documents or links to understand... sherlinpraveenkumar IDMS/ADSO 5 Wed Oct 28, 2015 4:40 pm

Back to Top
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us