call procedure(1) — Commands
Digital
NAME
CALL PROCEDURE − Calls a processing procedure in a processing group.
SYNOPSIS
[<label-name>:] CALL PROCEDURE <processing-procedure-name>
IN <processing-group-name>
[ USING { <workspace-name> } ] [ ,... ] ;
PARAMETERS
•label-name
An internal unqualified identifier associated with the statement, for use in flow control operations
•processing-procedure-name
A qualified external identifier giving the name of the processing procedure in the processing group.
The processing procedure name must match the name of a processing procedure in the processing group specification. The processing group specification that contains the corresponding processing procedure must be available when you compile the task definition.
•processing-group-name
An unqualified external identifier that gives the name of the processing group in which the interface for the CALL PROCEDURE is found. The processing group name can have a maximum of 17 characters.
•workspace-name
Either an unqualified internal identifier for the name of a private workspace or an unqualified external identifier for the name of a shared workspace used for data storage and for arguments passed in procedure and task calls. You must declare the workspace name in the workspace declaration of the task.
The workspace name of a private workspace must be unique within a task definition. The workspace name of a shared workspace must be unique within a task group specification. A workspace name cannot be used for both a private workspace and a shared workspace in the same task definition.
DESCRIPTION
If the CALL PROCEDURE statement is used in a noncomposable task, it must inside a transaction block.
The processing procedure specified in the processing procedure name in the CALL PROCEDURE statement can participate in the same transaction as the calling task or control its own transaction. This participation depends on the transaction model specified when you build the task server or processing server.
In the USING phrase, the arguments must match the arguments in the processing procedure in the processing group specification in number, order, data types for fields, and lengths of fields within workspaces. For the top-level processing procedure, arguments are passed by reference.
The normal execution flow for a CALL PROCEDURE statement is:
1.Call the top-level processing procedure, passing the INPUT or INOUT arguments defined in the processing procedure.
2.When the processing procedure completes, return the arguments defined as OUTPUT or INOUT to the corresponding workspaces.
3.Complete with default flow control.
The execution flow varies from the sequence described above when a condition listed in the Exceptions section occurs. The call procedure completes with the exception and the values of the workspaces corresponding to the arguments defined as OUTPUT or INOUT are no longer valid.
EXCEPTIONS
The CALL PROCEDURE statement can generate the exception classes described in the following sections. The sections describe the conditions leading to the exception class and suggest actions to take.
You can program the processing procedure to return any exception class.
AP-EXECUTION-FAULT
The AP-EXECUTION-FAULT exception class indicates one of the following error conditions:
oThe top-level processing procedure specified by the processing procedure name in the CALL PROCEDURE or a nested processing procedure called before returning to the top-level processing procedure contains an unhandled programming or logic error, such as an access violation or an unhandled divide-by-zero.
oThe value of the DEPENDING ON field was invalid when referring to a workspace name or workspace field containing a variable-length array.
AP-INVOCATION-FAULT
The AP-INVOCATION-FAULT exception class indicates that a specification mismatch occurred on a CALL PROCEDURE. The interface for the called processing procedure does not match the interface for a processing procedure in the processing group specification used when the calling task was compiled.
AP-RESPONSE-FAULT
The AP-RESPONSE-FAULT exception class indicates that the results of the CALL PROCEDURE could not be returned to the task that called the processing procedure because of a syntax error.
ENV-EXECUTION-ERROR
The ENV-EXECUTION-ERROR exception class indicates that the top-level processing procedure specified by the processing procedure name in the CALL PROCEDURE could not complete because of a system failure on the TP system in which the task is executing.
ENV-INVOCATION-ERROR
The ENV-INVOCATION-ERROR exception class indicates one of the following error conditions:
oThe top-level processing procedure specified by the processing procedure name in the CALL PROCEDURE is disabled.
Follow the procedures for enabling a procedure described in ACMSxp Developing and Managing Applications.
oThe processing group specified by the processing group name in the CALL PROCEDURE is not available because of a system failure.
ENV-INVOCATION-FAULT
The ENV-INVOCATION-FAULT exception class indicates that the processing group specified by the processing group name in the CALL PROCEDURE is not defined within the TP system in which the task is executing.
RELATED INFORMATION
Syntax: exception_handler(1), processing_group(1), processing_procedure(1), task_definition(1)