/* --------------------- rexx procedure ---------------------- */ /* Name: TSOTRAP */ /* */ /* Function: This Rexx procedure will accept any TSO command */ /* (including clists and other Rexx procedures) */ /* that output to the terminal and trap the output */ /* and then display the results using ISPF Browse. */ /* */ /* Syntax: %TSOTRAP tso-command options */ /* */ /* Author: Lionel B. Dyck */ /* Rockwell International */ /* P.O. Box 2515 */ /* Seal Beach, California 90740 */ /* (310) 797-1125 */ /* IBMLINK: ROK2027 */ /* */ /* Similar to edit macros @STRAP etc. by D.McR */ /* The TSOTRAP procedure should prove useful to CUT lines out */ /* and to paste elsewhere later. */ /* */ /* History: 1990/07/23 - Rexx procedure created. */ /* 1990/10/04 - update to larger lrecl for trap d/s */ /* 1992/01/19 - D.McR use EDIT, exit if TRAP.0=0 */ /* 1992/01/20 - D.McR .LIST in dsname for profile */ /* 1994/06/30 - D.McR Provide for NOPREFIX users */ /* */ /* ------------------------------------------------------------- */ arg command sysuid = SYSVAR('SYSUID') /* to provide for NOPREFIX users */ if length(command) = 0 then do say "Error: Use of TSOTRAP requires the specification of" say " a TSO command whose results will be captured" say " and displayed using ISPF Browse/Edit." say " (e.g. %TSOTRAP LISTC)" exit 12 end x = outtrap("trap.","*") command x= outtrap("off") if trap.0 = 0 then do; say ' ';x = '***** Unable to Trap command ******';say x||x exit 12 end dd = "TP"random() "ALLOC F("dd") DS('"sysuid".TSOTRAP."dd".LIST') NEW SPACE(10,30)", "TRACKS LRECL(130) RECFM(F B) BLKSIZE(0)" "EXECIO * DISKW" dd "(FINIS STEM trap." /*Address ISPEXEC "BROWSE DATASET(TSOTRAP."dd")" */ Address ISPEXEC "EDIT DATASET('"sysuid".TSOTRAP."dd".LIST')" "FREE F("dd") DELETE"