/*****REXX************************************************************** MACRO: @PRINT3-- dataset currently being edited by SPF @PRINT will be one of @PRINT, @PRINT1, @PRINT2, @PRINT3 PURPOSE: interface to printps.exe PostScript printer*************/ /* Macro to print current file to PostScript printer at LPT1 */ /*********************************************************************/ /* @PRINT NOTE requires special procesing */ /* labnx lab(data) */ /* md on all NOTE lines */ /* labnx lab(note) */ /* md on all MSG lines */ /* labnx lab(msg) */ /* @print note */ /*********************************************************************/ address "ISREDIT"; "macro (parm)" parse version v1 v2 v3 v4 v5 'ISREDIT (modified) = DATA_CHANGED' xx10 = "----------------------" /* line(s) not displayed*/ xx06 = "------" "(filename) = dataset" parm=translate(' 'parm' '); i=pos(' NX ',parm); if i=0 then nxopt=0; else nxopt=1 i=pos(' E ',parm); if i=0 then editopt=0; else editopt=1 i=pos(' EDIT ',parm); if i=0 then editor=0; else editor=1 i=pos(' DOC ',parm); if i=0 then docopt=0; else docopt=1 i=pos(' NUM ',parm); if i=0 then numopt=0; else numopt=1 i=pos(' LBL ',parm); if i=0 then lblopt=0; else lblopt=1 i=pos(' NOTE ',parm); if i=0 then lblnote=0; else lblnote=1 if lblnote = 1 then do; editor=1;editopt=1;numopt=1;nxopt=1;end; if editor=1 then do; editopt=1; numopt=1; end; if nxopt=1 then numopt=1 notecnt = 0 q.=""; qcnt=3; q.1=" "; q.3=" "; q.4=" " date1 = left(date('s'),4)"/"substr(date('s'),5,2)"/"right(date('s'),2) q.2 = filename " printed" date1 "at" left(time('n'),5) if (modified=YES) then q.2 = "**Modified**" q.2 possible = 0 copied = 0 LABF = ".ZFRANGE" LABL = ".ZLRANGE" "(first) = linenum .zfrange" "(last) = linenum .zlrange" if first = 0 then first = 1 if last = 0 then "(last) = linenum .zlast" if docopt = 1 then qcnt = qcnt + 2 /* will fill in later*/ xbunch=0 if editor = 1 then do line = "SPF/PC(1) EDIT" left(filename,48,"-") "COLUMNS ... ..." qcnt=qcnt+1; q.qcnt=line line = "COMMAND ===>" left(" ",48) "SCROLL ===> CSR" qcnt=qcnt+1; q.qcnt=line line = "******" left("*",33,"*") "TOP OF DATA" left("*",26,"*") qcnt=qcnt+1; q.qcnt=line end do i = first to last possible= possible+1 if nxopt = 1 then do address "ISREDIT" "(xstatus) = xstatus" i if xstatus \= "NX" then do; xbunch=xbunch+1; iterate i;end; if xbunch \= 0 then do qcnt=qcnt+1 /* fixup for would not print line 71 so make it 72*/ if (qcnt+70)//70 = 1 then do; q.qcnt=" "; qcnt=qcnt+1; end; q.qcnt = xx10 xbunch "LINE(s) NOT DISPLAYED" xx10 if numopt then q.qcnt=xx06 q.qcnt xbunch = 0 end end address "ISREDIT" "(line) = line" i "(label) = label" i "0" label = left(label,6) number= i - notecnt number = right("000000"number,6) x3 = left(label,3) if x3 = '.DA' then do; label=" "; end; if x3 = ".NO" then do; notecnt = notecnt + 1; number="=NOTE=" label = "";end; if x3 = ".MS" then do; notecnt = notecnt + 1; number="==MSG>" label = "";end; if x3 = ".IN" then do; notecnt = notecnt + 1; number="=INFO=" label = "";end; if lblopt /=1 then if label /= "" then number =label if numopt /= 1 then number ="";else number=left(number,7) if lblopt /= 1 then label ="";else label=left(label,7) line = label||number||line qcnt=qcnt+1; if (qcnt+70)//70 = 1 then do; q.qcnt=" "; qcnt=qcnt+1; end; q.qcnt = line copied = copied + 1 end /* catch up for last lines not being displayed*/ if xbunch \= 0 then do qcnt=qcnt+1 if (qcnt+70)//70 = 1 then do; q.qcnt=" "; qcnt=qcnt+1; end; q.qcnt = xx10 xbunch "LINE(s) NOT DISPLAYED" xx10 if numopt then q.qcnt= xx06 q.qcnt xbunch = 0 end if editor = 1 then do line = "******" left("*",32,"*") "BOTTOM OF DATA" left("*",24,"*") qcnt=qcnt+1; q.qcnt=line end q.0 = qcnt if docopt = 1 then do if nxopt = 1 then q.3 = left('.***',40) "Copied" copied "of" possible else q.3 = '.***' q.4 = '.***' date1 time() dochdr '-- Lines', strip(first,'l','0')'-'strip(last,'l','0') end /* macros named cutR, appendR, pasteR */ CUTDSNnn = "CUTDSN"||Random(99) CUTDSN = "c:\temp\"CUTDSNnn".tmp" stream(cutdsn,'C',"CLOSE") /* close the file*/ address "CMD" "DEL" cutdsn do i=1 to qcnt; call lineout CUTDSN, q.i;end; call lineout CUTDSN /* close file*/ stream(cutdsn,'C',"CLOSE") /* close the file*/ if editopt = 1 then do if v1 = "REXXSAA" then Address "cmd" "spf2" CutDsn "/e" if v1 = "REXX/2" then Address "cmd" "spfpc" cutdsn "/e" ZEDSMSG = "Print Suppressed" ZEDLMSG = "Print Suppressed with E for edit option" 'ISPEXEC SETMSG MSG(ISRZ000)' exit end ADDRESS CMD 'printps' CutDsn ZEDSMSG = "@PRINT RC="RC ZEDLMSG = "@PRINT RC="RC", printed "CutDsn 'ISPEXEC SETMSG MSG(ISRZ000)' /*********************************************************************/ /* PRINTPS was free so can't complain, but it does not allow me */ /* to change it's settings. So I would lose the first and */ /* every 70th line on page breaks. So I add extra lines. */ /* I have to print PostScript, or go crazy changing printer */ /* options to use a typeface that I would rather not use anyway. */ /* PRINTPS was probably obtained from WINSITE collection */ /* PRINTPS.zip */ /* David McRitchie, The REXX Macros Toolbox, 1997/03/10 */ /*********************************************************************/