You can use CALL identifier (where identifier is not a procedure-pointer) to call a nested ILE COBOL program or to call a program object. The contents of the identifier determine, at run time, whether a nested program is called or a program object is called. If the contents of the identifier match the name of a visible nested program, then the call is directed to the nested program. Otherwise, a dynamic program call is made to a program object with the name specified in the contents of the identifier.
An IN LIBRARY phrase specified on a CALL identifier forces the call to be to a program object.
An open pointer that associates a CALL identifier (and any associated IN LIBRARY item) 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 following example shows how to apply the CANCEL statement to an identifier:
MOVE "ABCD" TO IDENT-1. CALL IDENT-1. CANCEL IDENT-1.
If you apply the CANCEL statement directly to the literal "ABCD", you do not null the open pointer associated with IDENT-1. Instead, you can continue to call program ABCD simply by using IDENT-1 in your CALL statement.
The value of the open pointer also changes if you change the value of the CALL identifier and perform a call using this new value. The value of the open pointer is also affected by any associated IN LIBRARY item. If a different library is specified for a CALL to IDENT-1 than on a previous call to IDENT-1, the open pointer is reset.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.