Previous Topic: Housekeeping StatementsNext Topic: BIND RECORD Statement


BIND RUN-UNIT Statement

The first database function executed within your program must be a BIND RUN-UNIT in order to establish a session with the DBMS. You can code this in one of two ways:

The COPY IDMS SUBSCHEMA-BINDS causes the precompiler to generate the BIND RUN-UNIT statement followed by BIND RECORD statements for every subschema record whose description is included in the program.

In deciding which statement to use, consider the following:

The following COBOL example binds a run unit to the EMPDEMO database:

MOVE 'MYPROG' TO PROGRAM-NAME.
BIND RUN-UNIT DBNAME 'EMPDEMO'.
PERFORM IDMS-STATUS.
If your program serially initiates and terminates multiple run units, you should re-initialize the ERROR-STATUS field to '1400' before starting each subsequent run unit.