I want to write a batch program with IMS that can get all the records in the database. The structure of my database is as follows: a root segment and a segment below it that has several occurrences and another segment under the second segment that also has several occurrences. How can I do this? So that the least call function is used?
Asked
Active
Viewed 61 times
0
-
[Coding a batch (IMS) program in COBOL](https://www.ibm.com/docs/en/ims/13.1.0?topic=SSEPH2_13.1.0/com.ibm.ims13.doc.apg/ims_codingbatchcobol.html) – Gilbert Le Blanc Jun 07 '23 at 17:39
1 Answers
0
You can use the GN call (Get Next) to traverse through an entire database sequentially. You may issue GN calls until you receive a GB status code back which means essentially means "end of database".
https://www.ibm.com/docs/en/ims/15.1.0?topic=management-gnghn-call

Bobshift
- 21
- 2