|

Chicago-Soft
ATTN: TSO Times
One Maple Street
Hanover, NH 03755
(603) 643-4002
information
@tsotimes.com

|
|
Quick Tip - ISPF Edit Macro
by Robert Mala
The following is an
ISPF Edit Macro that will take non-excluded lines from the current edit
session and
execute the DB2 utility program DSNTEP2, browsing the results.
Download this macro
in text format (FA96QT1-ISPF.TXT)
/* REXX */
/**********************************************************************/
/* Description: Edit macro to submit current edit session to
DSNTEP2 in foreground and browse the output. */ /**********************************************************************/
address ISPEXEC "ISREDIT MACRO"
j = 0
/* Save the current non-excluded lines from the current edit session */
address ISPEXEC "ISREDIT (lines) = LINENUM .ZLAST"
do i = 1 to lines
address ISPEXEC "ISREDIT (status) = XSTATUS" i
if status = 'NX' then do
address ISPEXEC "ISREDIT (line) = LINE" i
j = j + 1
sysin.j = line
end
end
/* Display a message if all the lines are excluded and exit */
if j = 0 then do
zedsmsg = 'All lines are excluded'
address ISPEXEC "SETMSG MSG(ISRZ001)"
exit
end
/* Allocate SYSIN and SYSPRINT ddnames to temporary files and write
the saved edit session lines to SYSIN */
"ALLOC DDNAME(SYSIN) NEW UNIT(DISK) SPACE(3) TRACKS REUSE"
"EXECIO * DISKW SYSIN (STEM sysin. FINIS"
"ALLOC DDNAME(SYSPRINT) NEW UNIT(DISK) SPACE(8,2) TRACKS REUSE"
"NEWSTACK"
/* Place the RUN and END commands on the data stack and execute DSN */
queue "RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) LIB('[dsntep2 library]')"
queue "END"
address TSO "DSN SYSTEM(DSN)"
"DELSTACK"
/* Browse the SYSPRINT file */
address ISPEXEC "LMINIT DATAID(idvar) DDNAME(SYSPRINT)"
address ISPEX
EC "BROWSE DATAID(" || idvar || ")"
address ISPEXEC "LMFREE DATAID(" || idvar || ")"
/* Free the SYSIN and SYSPRINT ddnames */
"FREE DDNAME(SYSIN,SYSPRINT)"
zedsmsg = 'Macro completed'
address ISPEXEC "SETMSG MSG(ISRZ001)"
exit
Robert Mala, Edgeware,
Middlesex, London
|
 |

|