Platforms for CallAPIs

CallAPIs are supported for the platforms BS2000, Java, NSK, OS/400, SAP, UNIX, VMS, Windows, and z/OS. The files are supplied with the Automation Engine and examples are provided for each platform.

This page includes the following:

CallAPI for BS2000

You define the code table that should be used in the INI file of the CallAPI for BS2000. Enter the name of the CodeTable object in the parameter codetable= of the section [GLOBAL]. For more information, see Call API BS2000.

Use Your Own Program

You can assign all parameters that are required with your program. It must only include the module UCCALL3, or dynamically reload it at runtime. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The supplied package includes the utility UCXBB2?C. You can use it in BS2000 procedures or batch jobs. For further information, see Use the CallAPI Utility (ucxbxxxc).

The utility reads the data that is required for logging in to the Automation Engine through SYSDTA. The AE Script that should be executed can either derive from a file or directly from SYSDTA. If you use a file, you must assign it before the program is called by using the link name UCSCRIPT.

Examples

In the first example, the link name UCSCRIPT is not assigned. The AE Script that should 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 that should 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 are written in a job variable (JV). 

/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)

CallAPI for Java

Use Your Own Program

You can use the CallAPI for Java with your own program. For further information, see Use the CallAPI with your Own Program.

Use the Utility

You can call the file UCCALL3.JAR from the command line, or from a batch file. A sample file (UCCALL3.BAT) that explains how you call it from a batch file is supplied with the AE files. For further information, see Use the CallAPI Utility (ucxbxxxc).

Example

The CallAPI is called with the login data of client 0098 and can be accessed without using a password. The following example activates an AE Script which is stored in the file SCRIPT.TXT.

java -jar uccall3.jar script=script.txt logon=98,smith,uc4

CallAPI for NSK

Use Your Own Program

You can use the CallAPI for Java with your own program. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The utility UCXBNS1C is part of the AE package. You can call it from the command line of the relevant operating system, from a script or a job. For further information, see Use the CallAPI Utility (ucxbxxxc).

Examples

The first example calls the utility with the connection and login information that is specified in the form of parameters. The utility reads the processing instructions (AE Script) from the file "SCRFILE" which is also specified as a parameter.

run ucxbns1c script=SRCFILE LOGON=1000,SMITH,UC4

The second example calls the utility with the script file being specified as a parameter. Connection and login data, and additional information are read from the INI file.

run ucxbns1c script=SRCFILE INI=UCXBNS1I

CallAPI for OS/400

Use Your Own Program

You can use the CallAPI for OS/400 with your own program. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The supplied utility UCXBO41C is available in the library and may be used in OS/400 CL scripts. For further information, see Use the CallAPI Utility (ucxbxxxc).

The AE Script that should be executed is read from a file member.

Example

The libraries are adjusted to your AE installation.

CALL PGM(UC4/UCXBO41C) +
PARM('INI=UC4/INI(UCXBO41C)' 'LOGON=<your four-digit client number>,<your user>,<your password>' 'SCRIPT=UC4/INI(SCRSAMP)')

CallAPI for SAP

The RFC Server transfers the script to the AE system. It includes a function module called UC4 which you can call in your ABAP programs.

The folder "sample" of the supplied files includes sample programs which explain how you can use it. For further information, see Use the CallAPI Utility (ucxbxxxc).

Function Module UC4

Sound knowledge of ABAP/4 is required to understand the following descriptions:

Import Parameter

Export Parameter

Tables

Exceptions

 Example

Call the function module:

call function 'UC4' destination 'UC4'
exporting
client = p_clint
trcflg = '0'
userabtl = p_usera
username = p_usern
userpass = p_userp
importing
msg = omessg
run = orunnr
tables
script = uscript
exceptions
logon_failed = 1
others = 99.

CallAPI for UNIX

Use Your Own Program

The program UCXBXXXC.c is available as C source code. The corresponding structure definitions are stored in the file UCCALL3.h. These files and the MakeFile for compiling the example are available in the directory /src. Update the supplied example with your data. Adjust the MakeFile MAKEFILE_EXAMPLE.??? to your environment. Rename it to MAKEFILE and now you can call it with make because MAKEFILE is the default name. Now you can generate an EXE file and test the CallAPI. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The utility UCXB???C is supplied with the AE files. You can either call it from the command line or from an executable file.

AE Script is used to define processing steps which are assigned as default input when the program is called: The entry < file name reads the AE Script from the corresponding file. The entry <<EOF_SCRIPT reads the AE script from the command line until the text "EOF_SCRIPT" is recognized.

Examples

In the first example, the utility is called with the AE Script being read from the file script.txt. Connection and login specifications are read from the INI file.

./UCXBUI5C SCRIPT=./script.txt

In the second example, the connection and login specifications are passed from the CallAPI.

./ucxblx6c SCRIPT=script.txt LOGON=0001,SMITH,DEV, aerox

CallAPI for VMS

Use Your Own Program

The program UCXBVXXC.C is available as C source code. The corresponding structure definition is stored in the file UCCALL3.H. A command for compiling the example is available MAKEXAMP.COM. Update this example with your data and adjust it to your environment. In doing so, you can generate an EXE file, and can test the CallAPI. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The delivery package includes the utility UCXBV??C.EXE which you can call from a command file. For further information, see Use the CallAPI Utility (ucxbxxxc).

Processing steps that are defined with AE Script are read by the standard input.

CallAPI for Windows

Use Your Own Program

You can use the CallAPI for Windows with your own program. For further information, see Use the CallAPI with your Own Program.

Use the Utility

No installation is required for using the CallAPI. Only verify that the utility can access the file UCXBWI3C.DLL. For further information, see Use the CallAPI Utility (ucxbxxxc).

Example

In the following example, the utility is called with the login data of client 0098. Access is possible without a password. The aim is to activate an AE Script which is stored in the file SCRIPT.TXT.

UCXBXXXC SCRIPT=SCRIPT.TXT LOGON=98,SMITH,UC4

CallAPI for z/OS

You define the code table that should be used in the INI file of the z/OS CallAPI. Enter the name of the CodeTable object in the [GLOBAL] section, parameter codetable=. If this parameter is empty, the IBM default code table is used.

Use Your Own Program

You can use the CallAPI for z/OS with your own program. For further information, see Use the CallAPI with your Own Program.

Use the Utility

The delivery package includes the utility UCCALL4 which you can use in z/OS jobs. You find it in the load library. For further information, see Use the CallAPI Utility (ucxbxxxc).

The AE Script which should be processed in the Automation Engine is read from SYSIN. You can also use the data definition instead of the dataset names as you can see in the following examples.

If the utility should be used in a job, the user must be authorized to communicate through TCP/IP.

The parameter REGION= should be set at least to 65M as otherwise, errors will occur.

Examples

Dataset names must be adjusted to your installation and z/OS configuration.

The latest CallAPI, version 4, is written in LE C and supports AES encryption and IPv6:

//UC4JOB   JOB ......
//UCCALL   EXEC PGM=UCCALL4,REGION=65M,
//    PARM='INI=FLQ.UCXBM25C.INI LOGON=<your four-digit client number>,<your user>,<your password>'
//STEPLIB  DD DSN=FLQ.UCXJM25.LOAD,DISP=SHR
//*        You can use the following command
//*        instead of the PARM INI=AE-inifile
//*UCINI    DD DSN=AE-inifile,DISP=SHR
//SYSIN    DD *
:SET &RUNNR = ACTIVATE_UC_OBJECT(JOBS,ExampleL1)
:IF &RUNNR = '0000000'
:   SET &ERROR = SYS_LAST_ERR_NR
:   STOP MSG,51,'ACTIVATION ERROR: &ERROR'
:ELSE
:   STOP NOMSG,50,'JOB WAS STARTED WITH RunID &RUNNR'
:ENDIF
/*
//

The previous CallAPI, version 3, which is written in Assembler can still be used:

//UC4JOB   JOB ......
//UCCALL   EXEC PGM=UCXBM25C,REGION=65M,
//    PARM='INI=FLQ.UCXBM25C.INI LOGON=<your four-digit client number>,<your user>,<your password>'
//STEPLIB  DD DSN=FLQ.UCXJM25.LOAD,DISP=SHR
//*        You can use the following command
//*        instead of the PARM INI=AE-inifile
//*UCINI    DD DSN=AE-inifile,DISP=SHR
//SYSIN    DD *
:SET &RUNNR = ACTIVATE_UC_OBJECT(JOBS,ExampleL1)
:IF &RUNNR = '0000000'
:   SET &ERROR = SYS_LAST_ERR_NR
:   STOP MSG,51,'ACTIVATION ERROR: &ERROR'
:ELSE
:   STOP NOMSG,50,'JOB WAS STARTED WITH RunID &RUNNR'
:ENDIF
/*
//

See also:

CallAPI