MainframeSupports
tip week 27/2003:

In the tip from week 23 I promised to return with more information on the subject of sysout trapping from TSO commands. Now is the time to present one of my more exciting ideas. The ultimate REXX program for execution of TSO commands.

Before presenting the program to you there are some things you have to be aware of. The program is not ready to run in ISPF split screen mode. To make it work correctly you must develop your own solution or contact me for further ideas. Error processing in the program is almost non existing. The allocation of the VIO dataset can be optimized. Very important: it is not all TSO commands that can be trapped, and an example is unfortunately all TSO HSM commands. And maybe there are misspellings in the program.

/* REXX - BROWSE OUTPUT FROM ALMOST ANY TSO-COMMAND */
ARG COMMAND
ADDRESS TSO "ALLOCATE FILE(TRAPPED) UNIT(VIO) BLOCK(4096)",
            "SPACE(1) BLKSIZE(4089) LRECL(125) RECFM(V B)"
IF RC = 0
THEN DO
  CALL OUTTRAP('COMMAND.')
  ADDRESS TSO COMMAND
  CALL OUTTRAP('OFF')
  ADDRESS TSO "EXECIO * DISKW TRAPPED (STEM COMMAND. OPEN FINIS)"
  IF RC = 0
  THEN DO
    ADDRESS ISPEXEC "LMINIT DATAID(TRAPPED) DDNAME(TRAPPED)"
    IF RC = 0
    THEN DO
      ADDRESS ISPEXEC "BROWSE DATAID("TRAPPED")"
      ADDRESS ISPEXEC "LMFREE DATAID("TRAPPED")"
    END
  END
  ADDRESS TSO "FREE FILE(TRAPPED)"
END
EXIT

The idea behind this program is simply to present the output in an ISPF browse session. Then you can browse up and down in the output as you wish. The ultimate idea is that you only need this program to deal with all the different TSO commands. Let me assume that the name of the REXX is TRAP. Then the TSO command TSO %TRAP HELP HELP result in a browse session where you can read almost all about using the TSO HELP command. TSO %TRAP LU will browse all the RACF information for your TSO user. Now you can start with your own needs.

Previous tip in english        Sidste danske tip        Tip list