Functions

Describes the functions you can use with the MVSCASPB API.

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  '.
...
To call a function from a COBOL program, move the value of one of these fields to the 03 ()-FUNC field defined in mfpubcas.cpy. For example, if you have included mfpubcas.cpy in your program, replacing () with WS:
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.