Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-21
CALL Statement
CALL Statement
The CALL statement transfers control from one SCREEN COBOL program to another
SCREEN COBOL program.
data-name
is a nonnumeric data item in the Working-Storage Section or Linkage Section; the
value of the data item gives the PROGRAM-ID of another SCREEN COBOL
program, as specified in the Identification Division of that program. The
data-name
specification allows the PROGRAM-ID of the called program to be
specified dynamically.
program-unit-name
is a nonnumeric literal or an identifier of a nonnumeric literal that gives the
PROGRAM-ID of another SCREEN COBOL program, as specified in the
Identification Division of that program. A nonnumeric literal is defined in the
SCREEN COBOL language as being enclosed in quotation marks. However, a
search on the name of the program unit will find the program-unit name even if it is
not enclosed in quotation marks. The program can be compiled for any terminal
type; for more information, see Compatibility for a Called Program on page 6-28.
If a literal specifying the called program unit is also the name of a section in the
calling program, an error results at compile time. This situation may be avoided by
specifying the called program unit with a Working-Storage identifier of a
nonnumeric literal rather than a literal.
USING
passes data to the program called. A USING phrase must be specified in the
Procedure Division header of the called program. The number of identifiers for this
phrase in the CALL statement must be at least as great as that specified for the
USING phrase in the called program.
identifier
is the name of an argument passed to the called program. This identifier cannot
exceed 12,288 bytes; it must be an 01 or 77 level data item in the Working-
Storage Section or Linkage Section of the program that is calling the other
program. The identifiers in the USING phrase must correspond exactly in number
and structure to the number and structure of the identifiers specified in the USING
phrase of the Procedure Division header of the called program. Correspondence
is by position in the USING lists. See the description of the Linkage Section on
CALL {
data-name
} [ USING {
identifier
} ,... ]
{
program-unit-name
}
[ ON ERROR
imperative-statemen
t ]










