Examples Using APPC/MVS Services

The following example illustrates the syntax for invoking an SAA CPI Communications call under the CPICOMM host command environment:

CPICOMM Example

/* REXX */
ADDRESS CPICOMM ’CMALLC conversation_id return_code’
if return_code = CM_OK then say 'OK!'
                       else say 'Why not?'

The following example illustrates the syntax for invoking an APPC/MVS call under the LU62 host command environment:

LU62 Example

/* REXX */
ADDRESS LU62 ’ATBDEAL conversation_id deallocate_type’,
                          ’notify_type return_code’

Whenever you issue an SAA CPI Communications call or APPC/MVS call from a REXX program, the entire call must be enclosed in single or double quotes.

SAA CPI Communications calls and APPC/MVS calls can use pseudonyms rather than integer values. In the CPICOMM example, instead of comparing the variable return_code to an integer value of 0, the example compares return_code to the pseudonym value CM_OK. The integer value for CM_OK is 0. TSO/E provides two pseudonym files, one for the LU62 host command environment and one for the CPICOMM host command environment. These files define the pseudonyms and their integer values. The LU62 pseudonym file is REXAPPC1, and the CPICOMM pseudonym file is REXAPPC2. Both files are found in SYS1.SAMPLIB. You can include this information from the pseudonym files in your REXX execs.

For more information about host command environments and pseudonym files, refer to z/OS TSO/E REXX Reference.