Calling CPI Communications Routines
All CPI Communications calls have a general calling format as follows:
CALL routine_name (parameters,return_code)
Some specific calling formats for languages that can invoke the services
are:
- COBOL
- CALL “routine_name” USING parm1,parm2,...return_code
- FORTRAN
- CALL routine_name (parm1,parm2,...return_code)
- C
- routine_name (parm1,parm2,...return_code)
- PL/I
- CALL routine_name (parm1,parm2,...return_code)
- REXX
- ADDRESS CPICOMM “routine_name parm1 parm2 ...return_code”
For REXX, enclose the routine name and all parameters within one pair of single or double quotes. Parameters must be initialized to appropriate values. The host command environment resolves the parameter values. For more information, see z/OS TSO/E REXX Reference.
- RPG
- For RPG, begin the CPI communications call in column 28, and enter the
routine name in columns 33-42. For each parameter, list the PARM keyword
in column 28 and the parameter value in columns 43-48, as follows:
C *OS CALL "routine_name" C PARM parm1 C PARM parm2... C PARM return_code
Any high-level language that conforms to the following linkage conventions
may be used to issue CPI Communications calls on MVS:
- Register 1 must contain the address of a parameter list, which is a list of consecutive words, each containing the address of a parameter to be passed. The last word in this list must have a 1 in the high-order (sign) bit.
- Register 13 must contain the address of an 18-word save area.
- Register 14 must contain the return address.
- Register 15 must contain the entry-point address of the service being called.
- If the caller is running in AR ASC mode, access registers 1, 13, 14, and 15 must all be set to zero.
On return from the service, general and access registers 2 through 14 are restored (registers 0, 1 and 15 are not restored).