Using Cobol with Call API - Call API never executes in Automation Engine

Document ID : KB000084560
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Error Message :
N/A

When running, trying to use the CallAPI with Cobol code after modifying the configurations in the Cobol sample code: 

https://docs.automic.com/documentation/webhelp/english/AWA/12.0/DOCU/12.0/AWA%20Guides/help.htm#AE_AWA_Source/Integration/ucachs.htm

The CallAPI will not execute the script properly.

The CP logs will show that the user from the code logged in and then logged off, but the actions in the script section of the Call will never execute.

 
Environment:
OS: Unix
OS Version: All
Cause:
Cause type:
Configuration
Root Cause: The Cobol sample code needs several changes to make it work, as it is outdated.
Resolution:
Make the following changes to the Cobol code:

1) The HEX-25 in the script activation portion is adding a ‘%’ character and can be removed as this is mainframe specific and can be removed on Linux/Unix.

2) Logon should be changed from: 
CALL UCCALL3 USING UC4-RECORD 
UC4-LOGIN 
UC4-CP-LIST

to
CALL UCCALL3 USING UC4-RECORD 
UC4-LOGIN 
UC4-CP-LIST
BY VALUE 0
BY VALUE 0

Similar the call to activate from
CALL UCCALL3 USING UC4-RECORD, 
UC4-SCRIPT, 
RETURNING UC4-RC

to
CALL UCCALL3 USING UC4-RECORD, 
UC4-SCRIPT, 
BY VALUE 0, 
RETURNING UC4-RC

3) The parameter definition should be updated to the following:
01 UC4-RECORD. 
05 UC-OPERATION PIC X(4). 
88 UC-OPER-INIT VALUE 'INIT'. 
88 UC-OPER-LGON VALUE 'LGON'. 
88 UC-OPER-LGOF VALUE 'LGOF'. 
88 UC-OPER-ACTS VALUE 'ACTS'. 
05 UC-ERROR-CODE PIC X. 
88 UC-ERROR-OK VALUE ' '. 
88 UC-ERROR-INVALID-PARA VALUE 'P'. 
88 UC-ERROR-INVALID-OPCODE VALUE 'O'. 
88 UC-ERROR-INIT-FAILD VALUE 'I'. 
88 UC-ERROR-LOGON-FAILD VALUE 'Q'. 
88 UC-ERROR-REQM-MACRO VALUE 'R'. 
88 UC-ERROR-RELM-MACRO VALUE 'L'. 
88 UC-ERROR-SOCKET VALUE 'S'. 
88 UC-ERROR-TIMEOUT VALUE 'T'. 
88 UC-ERROR-FROM-UC4 VALUE 'U'. 
88 UC-ERROR-NO-CPLIST VALUE 'N'. 
05 UC-INTERFACE-NR PIC X(3). 
88 UC-INTERFACE-3 VALUE '003'. 
05 UC-SYSTEM-NAME PIC X(8). 
05 UC-TIMEOUT PIC 9(4) COMP-4. 
05 UC-LANGUAGE PIC X. 
05 FILLER PIC X(2). 
05 UC-FLAG1 PIC X. 
05 FILLER PIC X(2). 
05 UC-OUTPUT-LEN PIC 9(8) COMP-4. 
05 FILLER PIC X(16).
05 UC-RUNNR PIC 9(8) COMP-4. 
05 UC-RETURN-CODE PIC 9(8) COMP-4. 
05 UC-MESSAGE-TEXT PIC X(256). 
05  UC-PRT-INI USAGE POINTER.              
05  UC-HND-LOG USAGE POINTER.              
05  UC-HND-TRC USAGE POINTER.              
05  UC-HND-HLP USAGE POINTER.              
05  FILLER USAGE POINTER occurs 11.
05  UC-POINTER USAGE POINTER.  
05 UC-QUEUE-NAME PIC X(200).

4) The parameter area was designed to work with 32-bit, but was too short with 64-bit. The changes will make it address mode independent (at least in Unix).
05  UC-PRT-INI                             USAGE POINTER.              
05  UC-HND-LOG                             USAGE POINTER.              
05  UC-HND-TRC                             USAGE POINTER.              
05  UC-HND-HLP                             USAGE POINTER.              
05  FILLER                                 USAGE POINTER occurs 11.
05  UC-POINTER                             USAGE POINTER.        
         
        

 

Fix Status: No Fix

Fix Version(s):
N/A
Additional Information:
Workaround :
N/A