12. BREXX MVS Functions

12.1. Host Environment Commands

12.1.1. ADDRESS MVS

Interface to certain REXX environments as VSAM and EXECIO

12.1.2. ADDRESS TSO

Interface to the TSO commands, e.g. LISTCAT, ALLOC, FREE, etc.

12.1.3. ADDRESS COMMAND ‘CP host-command’

Interface to the Host system in which your MVS3.8 is running. Typically it is Hercules or VM370. The result of the command is displayed on screen, but can be trapped in a stem by the OUTTRAP command:

1call outtrap('myresult.')
2ADDRESS COMMAND 'CP help'
3call outtrap('off')
4/* result is stored in stem myresult. */
5do i=1 to myresult.0
6Say mayresult.i
7end

Some Hercules commands:

ADDRESS COMMAND ‘CP HELP’ to get a list of Hercules commands:

HHC01603I
HHC01602I Command           Description
HHC01602I ----------------  ----------------------------------
HHC01602I !message          *SCP priority message
HHC01602I #                 Silent comment
HHC01602I *                 Loud comment
HHC01602I .reply            *SCP command
HHC01602I ?                 alias for help
HHC01602I abs               *Display or alter absolute storage
HHC01602I aea               Display AEA tables
HHC01602I aia               Display AIA fields
...

ADDRESS COMMAND ‘CP DEVLIST’ shows a list of all active devices:

HHC02279I 0:0009 3215 *syscons cmdpref(/) IO[1541] open
HHC02279I 0:000C 3505 0.0.0.0:3505 sockdev ascii autopad trunc eof IO[3]
HHC02279I      (no one currently connected)
HHC02279I 0:000D 3525 /punchcards/pch00d.txt ebcdic IO[2] open
HHC02279I 0:000E 1403 /printers/prt00e.txt IO[6] open
HHC02279I 0:000F 3211 /printers/prt00f.txt IO[2] open
HHC02279I 0:0010 3270 GROUP=CONSOLE IO[3]
HHC02279I 0:0015 1403 /logs/mvslog.txt IO[2106] open
HHC02279I 0:001A 3505 0.0.0.0:3506 sockdev ebcdic autopad eof IO[3]
HHC02279I      (no one currently connected)

And many others: ADDRESS COMMAND ‘CP clocks’:

HHC02274I tod = DC8F485DBB377093    2022.349 21:07:20.582007
HHC02274I h/w = DC8F485DBB377093    2022.349 21:07:20.582007
HHC02274I off = 0000000000000000       0.000 00:00:00.000000
HHC02274I ckc = DC8F485DC0400000    2022.349 21:07:20.602624
HHC02274I cpt = 7FFFFF7A01C85F00
HHC02274I itm = 7C0E1623                     07:31:40.233415

If you run under control of VM370 you can run VM commands: ADDRESS COMMAND ‘CP vm-command’

12.1.4. ADDRESS FSS

Interface to the Formatted Screen Services. Please refer to formatted_screens.rst contained in the installation zip file.

Note

The following host environments enable you to call external programs. The difference is the linkage conventions, and how input parameters are treated.

12.1.6. ADDRESS LINKMVS

Call an external program. The linkage convention of the called program can be found here: The LINKMVS and ATTCHMVS host command environments

Example:

 1/* REXX - INVOKE IEBGENER WITH ALTERNATE DDNAMES. */
 2PROG = 'IEBGENER'
 3PARM = ''                    /* STANDARD PARM, AS FROM JCL */
 4DDLIST = COPIES('00'X,8) ||, /* DDNAME 1 OVERRIDE: SYSLIN   */
 5COPIES('00'X,8) ||,          /* DDNAME 2 OVERRIDE: N/A      */
 6COPIES('00'X,8) ||,          /* DDNAME 3 OVERRIDE: SYSLMOD  */
 7COPIES('00'X,8) ||,          /* DDNAME 4 OVERRIDE: SYSLIB   */
 8LEFT('CTL', 8) ||,           /* DDNAME 5 OVERRIDE: SYSIN    */
 9LEFT('REP', 8) ||,           /* DDNAME 6 OVERRIDE: SYSPRINT */
10COPIES('00'X,8) ||,          /* DDNAME 7 OVERRIDE: SYSPUNCH */
11LEFT('INP', 8) ||,           /* DDNAME 8 OVERRIDE: SYSUT1   */
12LEFT('OUT', 8) ||,           /* DDNAME 9 OVERRIDE: SYSUT2   */
13COPIES('00'X,8) ||,          /* DDNAME 10 OVERRIDE: SYSUT3  */
14COPIES('00'X,8) ||,          /* DDNAME 11 OVERRIDE: SYSUT4  */
15COPIES('00'X,8) ||,          /* DDNAME 12 OVERRIDE: SYSTERM */
16COPIES('00'X,8) ||,          /* DDNAME 13 OVERRIDE: N/A     */
17COPIES('00'X,8)              /* DDNAME 14 OVERRIDE: SYSCIN  */
18ADDRESS 'LINKMVS' PROG 'PARM DDLIST'

12.1.7. ADDRESS LINKPGM

Call an external program. The linkage convention of the called program can be found here:

The LINKPGM and ATTCHPGM host command environments

12.1.8. ADDRESS ISPEXEC

Support calls functions to Wally Mclaughlin ISPF for MVS on Hercules. The functions supported depend on the functionality implemented in his API. Example:

ADDRESS ISPEXEC
"CONTROL ERRORS RETURN"
"DISPLAY PANEL(PANEL1)"

12.1.9. OUTTRAP

If the commands writes output to terminal you can trap the output using the OUTTRAP command. This will redirect it to a stem variable of your choice. Output produced by TSO full-screen macros cannot be trapped:

1call outtrap('lcat.')
2ADDRESS TSO 'LISTCAT LEVEL “BREXX”'
3call outtrap('off')
4/* listcat result is stored in stem lcat. */
5do i=1 to lcat.0
6Say lcat.i
7end