Application Integration Guide > CallAPI > CallAPI and your own program > Cobol

 Cobol

The CallAPI can be used to process scripts in the AE system from your own  Java programs.

The delivery directory contains sample programs that provide a detailed description of how a script activation can be implemented.

General

Scripts are always activated with the following steps:

  1. Log on to the AE system.
  2. Transfer the script to the AE system.
  3. Log off from the AE system.

You can log on to several AE systems at the same time and process various scripts. In this case, a Dialog license is used for each connection.

Call

Call the CallAPI using the command CALL UCCALL3. Return code 0 is supplied if the action was successful or a message number if an error occurred.

Description

Call

Logging on to the AE system

CALL UCCALL3 USING structure, login data, connection

Format for login data:  
Client, user
, [departmentDepartment name to which the Automation Engine user belongs., [passwordA secret combination of characters for a Automation Engine user.]]

Format for connection data for the communication process:
DNS name:port number

or
TCP/IP address:port number

Activating a script

CALL UCCALL3 USINGstructure, script

Logging off the AE system

CALL UCCALL3 USING structure

Variables

The supplied sample program explains the structure AE-RECORD. It contains the following variables:

Variable

Data type

Description

UC-OPERATION

PIC X(4)

Operation code

This variable must be set if the universal function should be used.

Allowed values:
"OPC_LOGON" - logs on to the AE system
"OPC_LOGOFF " - logs off the AE system
"OPC_ACTIVATE_SCRIPT" - activates a script

UC-ERROR-CODE

PIC X

The error code in cErrorCode is automatically set and can contain one of the following values:

" " - no error occurred
"P" - invalid parameter(s)
"O" - invalid opcode
"I" - initialization failed
"Q" - login failed
"R" - memory allocation failed
"L" - memory release failed
"S" - socket error
"T" - timeout
"U" - error message of the AE system

UC-INTERFACE-NR

PIC X(3)

The interface number must always contain the value 3.

UC-SYSTEM-NAME

PIC X(8)

Name of the AE system to which the connection should be established

UC-TIMEOUT

PIC 9(4) COMP-4

Time in seconds during which the CallAPI waits for an AE system response

UC-LANGUAGE

PIC X

Language in which messages are output

FILLER

PIC X(2)

Not used

UC-FLAG1

PIC X

Depending on the specified value, this flag results in one of the processing options listed below:

"CALL_FLAG1_INI_SERVER" - connection to communication process is retrieved from INI file
"CALL_FLAG1_INI_LOGIN" - login data is retrieved from INI file
"CALL_FLAG1_INI_USEMSL" - converts variable message parts to a complete message text
"CALL_FLAG1_INI_USEALL" - settings made in the INI file section [GLOBAL] are used
"CALL_FLAG1_TRC_HANDLE" - for internal CallAPI processing only
"CALL_FLAG1_LOG_HANDLE" - for internal CallAPI processing only
"CALL_FLAG1_INI_FILE" - name of INI file
"CALL_FLAG1_TRC_OUTPUT" - for internal CallAPI processing only

FILLER

PIC X(2)

Not used

UC-OUTPUT-LEN

PIC 9(8) COMP-4

Not used

UC-RUNNR

PIC 9(8) COMP-4

RunID of the script

UC-RETURN-CODE

PIC 9(8) COMP-4

Return code of script execution

UC-MESSAGE-TEXT

PIC X(256)

Variable message part explaining the return code's value

UC-PRT-INI

PIC S9(8)

For internal CallAPI processing only

UC-HND-LOG

PIC S9(8)

For internal CallAPI processing only

UC-HND-TRC

PIC S9(8)

For internal CallAPI processing only

UC-HND-HLP

PIC S9(8)

For internal CallAPI processing only

UC-POINTER

PIC S9(8)

For internal CallAPI processing only

FILLER

PIC X(12)

Not used

UC-INIFILE

PIC X(45)

Path and name of INI file

 

See also:

About the CallAPI