/* 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 parse value line with line ' ' if line \= '' then do j = j + 1 sysin.j = line end 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(DSID) DDNAME(SYSPRINT)" address ISPEXEC "BROWSE DATAID(&DSID)" address ISPEXEC "LMFREE DATAID(&DSID)" /* Free the SYSIN and SYSPRINT ddnames */ "FREE DDNAME(SYSIN,SYSPRINT)" zedsmsg = 'Macro completed' address ISPEXEC "SETMSG MSG(ISRZ001)" exit