The following document includes information and notes required for using the CallAPI for BS2000.
The CodeTable to be used is specified in the BS2000 CallAPI's INI file. Enter the name of the CodeTable object in the parameter codetable= of the section [GLOBAL].
1. |
CallAPI and own program |
---|
The AE CallAPI can be called from your own programs. This requires sound knowledge of the programming language in which this program was written.
All the required parameters are assigned within the program. The program using the CallAPI must only include or dynamically reload the large module UCCALL at runtime.
2. |
CallAPI and utility |
---|
The supplied package includes the utility UCXBB2?C and is applicable in BS2000 procedures or "Enter" jobs.
The utility reads the data required for logging on to the Automation Engine via SYSDTA. The AE Script to be executed can either derive from a file or directly from SYSDTA. If a file is used, it must be assigned before the program is called using the file-catenation name UCSCRIPT.
In the first example, the file-catenation name UCSCRIPT is not assigned. The AE Script to be executed is read until it reaches the SYSDTA command /EOF.
/FILE UCXBB22C.INI,LINK=INI
/EXEC UCXBB22C
04,RS,PROG,PASSWORD
:SET &RUNNR = ACTIVATE_UC_OBJECT(JOBS,EXAMPLE1)
:IF &RUNNR = '0000000'
: SET &ERROR = SYS_LAST_ERR_NR
: SET &ERROR = SYS_LAST_ERR_NR
: STOP MSG,51,'ACTIVATION ERROR: &ERROR'
:ELSE
: STOP NOMSG,50,'THE JOB WAS STARTED WITH RunID &RUNNR'
:ENDIF
/EOF
The script to be executed is available in the file MY.SCRIPT.FILE:
/FILE UCXBB22C.INI,LINK=INI
/FILE MY.SCRIPT.FILE,LINK=UCSCRIPT
/EXEC UCXBB22C
04,RS,PROG,PASSWORD
The following example returns the RunID, the error code and the error message from the CallAPI. These three values will be written in a JV (job variable).
/CREATE-JV JV-NAME=#UC.RETCODE
/SET-JV-LINK LINK-NAME=UCRETC,JV-NAME=#UC.RETCODE
/CREATE-JV JV-NAME=#UC.RETTEXT
/SET-JV-LINK LINK-NAME=UCRETT,JV-NAME=#UC.RETTEXT
/CREATE-JV JV-NAME=#UC.RUNID
/SET-JV-LINK LINK-NAME=UCRUNID,JV-NAME=#UC.RUNID
/EXEC UCXBB23C
*INI
:SEND_MSG RS,DEV,'MESSAGE FROM THE BS2000 CALL INTERFACE &NAME.'
/EOF
/SHOW-JV JV-CONTENTS=*LINK(LINK-NAME=UCRUNNR)
/STEP
/SHOW-JV JV-CONTENTS=*LINK(LINK-NAME=UCRETC)
/SHOW-JV JV-CONTENTS=*LINK(LINK-NAME=UCRETT)
See also:
About the CallAPI
Using the CallAPI