Calling Language Environment services
To invoke a Language Environment® service,
use a CALL
statement with the correct parameters
for that service. Define the variables for the CALL
statement
in the DATA DIVISION
with the definitions that are
required by that service.
About this task
77 argument comp-1.
77 feedback-code pic x(12) display.
77 result comp-1.
. . .
CALL "CEESSSQT" using argument, feedback-code, result
In the example above, Language Environment service CEESSSQT calculates
the value of the square root of the variable argument
and
returns this value in the variable result
.
You can choose whether to specify
the feedback code parameter. If you specify it, the value returned
in feedback-code
indicates whether the service completed
successfully. If you specify OMITTED
instead of the
feedback code, and the service is not successful, a Language Environment condition is automatically
signaled to the Language Environment condition
manager. You can handle such a condition by recovery logic implemented
in a user-written condition handler, or let the default Language Environment processing for unhandled conditions
occur. In either case, you avoid having to write logic to check the
feedback code explicitly after each call.
If
you call a Language Environment callable service
and specify OMITTED
for the feedback code, the RETURN-CODE
special
register is set to 0 if the service is successful. It is not altered
if the service is unsuccessful. If you do not specify OMITTED
for
the feedback code, the RETURN-CODE
special register
is always set to 0 regardless of whether the service completed successfully.
Example: Language Environment callable services
Language Environment Programming Guide (General callable services)
Language Environment Programming Reference (General callable services)
CALL statement (Enterprise COBOL for z/OS® Language Reference)