The mfpubcas.cpy copybook contains several 78-level fields you can use to call API functions. These are documented in the copybook itself, under a section labeled functions. The name of each field describes the function itself.
The following is a partial listing from mfpubcas.cpy:
...
*=================================================================
* functions
*=================================================================
03 ()-FUNC PIC X(4).
78 78-CAS-FUNC-OPEN VALUE 'OP '.
78 78-CAS-FUNC-OPIO VALUE 'OPIO'.
78 78-CAS-FUNC-CLOS VALUE 'CLOS '.
78 78-CAS-FUNC-GN VALUE 'GN '.
...
move 78-CAS-FUNC-GN to WS-FUNC
A typical sequence of calls would contain the following functions:
| Function | Purpose |
|---|---|
| 78-CAS-FUNC-OPEN | To open the file |
| 78-CAS-FUNC-STGT | To position on a particular record (e.g., start, key greater than, etc.) |
| 78-CAS-FUNC-GN | To get the next record, and then repeated to get each subsequent record until all required records have been returned |
| 78-CAS-FUNC-CLOS | To close the file |