35. Execution RXS as TSO commands and from REXX

a) Handling RXS programs located in allocated libraries:

RXS programs can be be executed as TSO commands if they reside in an allocated library: The TSO session must allocate the file RXSLIB, pointing to one or more partitioned datasets containing the RXS programs. Such a dataset may have any attributes, but RECFM=VB and LRECL=255 is recommended.

tso rxs myrxs

provided that the RXS program myrxs resides in the RXSLIB library.

tso rxs myrxs what's up doc?

(Section 03)

exit 20

in the RXS program, the program will terminate in error, and TSO will receive return code RC=20.

 

A RXS program can be executed from a REXX program: 

Example 35.1

/* REXX */

XVAR = 'Killroy was here'

ADDRESS TSO

"RXS YRSA "XVAR

IF RC > 5 THEN DO

  SAY "'YRSA' set a return code" RC

END

The example calls an RXS named YRSA. YRSA will receive the string 'Killroy was here' in its variabel RXSPARM. The REXX program will receive a RC = nn if the RXS programs issues an EXIT nn.

 

b) Handling RXS programs located anywhere:

A RXS program may be executed from any commando line in ISPF by writing:

tso rxs 'ourgroup.ourlib.type(myrxs)'

That is, naming file and member name in normal ISPF syntax.

Executing a RXS program this way changes the behaviour of )IMBED: the search for imbed'ed RXS program is done solely in the indicated dataset

Naming both dataset and member is relevant when executiong a RXS program form a REXX program:

Example 35.2

/* REXX */

XVAR = 'Killroy was here'

ADDRESS TSO

"RXS 'OURGROUP.OURLIB.RXS(YRSA)' "XVAR

IF RC > 5 THEN DO

  SAY "'YRSA' set a return code" RC

END

 

Calling RXS this way, the call will function regardless of the allocations for the ISPF session.

 

c) Handling RXS programs when shown in an extended member-list:

Writing RXS in the command field of a member list will execute the indicated member as a RXS program.