/*REXX: @STRAP creating isredit cards of TSO COMMAND*/ /* @STRAP: SYSOUT TRAP of TSO COMMAND creating data cards*/ /* TITLE: @STRAP -- trap clist write statements and imbed at */ /* end of file in edit */ /* Users: TSO ISPF EDIT USERS */ /* Entry: Used as an EDIT CLIST within ISPF EDIT */ /* ===> @STRAP ddname all */ /* Contributed: 1985/08/29 David McRitchie */ /* Rewritten in REXX, D.McRitchie -- 1991/02/28*/ /* EXAMPLE: ===> @STRAP LISTC */ /* EXAMPLE: ===> @STRAP DDNAME ALL */ /* EXAMPLE: ===> @STRAP LISTRP */ Address "ISREDIT";"MACRO (TOKEN)" token = translate(token) x = OUTTRAP('var.','*',"CONCAT") Address "TSO" TOKEN do i = 1 to var.0; Card = var.i 'LINE_AFTER .ZL = (card)' If i = 1 then "LABEL .ZLAST = .new 0" end if var.0 = 0 then do ZEDSMSG = "No lines found" ZEDLMSG = 'No lines trapped, please also try @STRAPQ' token "LINE_BEFORE .ZFIRST = NOTELINE (ZEDLMSG)" ADDRESS "ISPEXEC" "SETMSG MSG(ISRZ000)" RETURN 1 end /* This clist uses the TSO/E feature SYSOUTTRAP. Any TSO command */ /* that uses PUTLINE to display output to the screen can be */ /* trapped. Output using TPUT or WTO macros will go directly */ /* to the screen and cannot be trapped. WRITE output from CLIST */ /* commands, and SAY output from REXX commands can be trapped. */