ILE COBOL Language Reference

CALL Statement Considerations

Call identifier

You can use CALL identifier (where identifier is not a procedure-pointer) to call a nested ILE COBOL program or a program object. The contents of the identifier determine, at run time, whether a nested program is called or a program object is called.

An open pointer that associates an identifier with an object is set the first time you use the identifier in a CALL statement.

If you carry out a call by an identifier to a program object that you subsequently delete or rename, you must use the CANCEL statement to null the open pointer associated with the identifier. This ensures that when you next use the identifier to call your program object, the associated open pointer will be set again.

The value of the open pointer changes if you change the value of the identifier and perform a call using this new value.

CALL procedure-pointer

You can perform a static procedure call or a dynamic program call using the CALL procedure-pointer statement.

Before using the CALL procedure-pointer statement, you must use the Format 6 SET Statement to set the value of the procedure-pointer data item. To set the procedure-pointer data item to an ILE procedure, specify LINKAGE TYPE IS PROCEDURE in the SET statement. To set the procedure-pointer data item to a program object, specify LINKAGE TYPE IS PROGRAM.

You can also use the LINKAGE TYPE clause of the SPECIAL-NAMES paragraph or the LINKLIT parameter of the CRTCBLMOD or CRTBNDCBL command to determine which type of object the procedure-pointer data item is set to. Refer to LINKAGE TYPE Clause for information on using the LINKAGE TYPE clause or the ILE COBOL for AS/400 Programmer's Guidefor information on using LINKLIT parameter.

Length of Parameters

If the length of any parameter (in bytes), as defined in the calling program, does not match the length expected by the called program, unexpected results could occur in the called or calling program. See the section on "Passing and Sharing Data between Programs" in the ILE COBOL for AS/400 Programmer's Guidefor details.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]