system(20) returns the most recent Spooler entry number generated by the
current process.
Hope that helps.
With Kindest Regards
Mike Wooding
Here is some code I wrote a number of years ago. Obviously some pre
and post code is necessary.
JOB.NO=SYSTEM(20)
*
* If you can read from the PEQS file, use this method
*
OPEN "DM,PEQS," TO PEQS ELSE RET.GOTO=999 ; RETURN
890 READ SPOOLER.REC FROM PEQS,JOB.NO ELSE
PRINT @(0,23):"SPOOLER JOB# NOT FOUND. ENTER (JOB#), OR <CR>
":
INPUT JOB.NO,5: ; PRINT @(0,23):@(-4):
IF JOB.NO="" THEN RET.GOTO=999 ; RETURN
GOTO 890
END
DELETE PEQS,JOB.NO
*
* AP/PRO method
*
SP.ID="SPOOL.ID.":PORT.NO
AM=CHAR(254)
DATA "S":AM:"F":AM:"SUSPENSE":AM:SP.ID:AM:"Y"
ECHO OFF
EXECUTE 'SP-EDIT ':JOB.NO
ECHO ON
895 READ SPOOLER.REC FROM SUSPENSE,SP.ID ELSE
PRINT @(0,23):"SPOOLER JOB# NOT FOUND. ENTER (JOB#), OR <CR>
":
INPUT JOB.NO,5: ; PRINT @(0,23):@(-4):
IF JOB.NO="" THEN RET.GOTO=999 ; RETURN
GOTO 895
END
DELETE SUSPENSE,SP.ID
IF SPOOLER.REC<1>[1,3]=".BP" THEN SPOOLER.REC=DELETE
(SPOOLER.REC,1,0,0)
K=DCOUNT(SREC,CHAR(254))
IF SPOOLER.REC<K>[1,3]=".CH" THEN SPOOLER.REC=DELETE
(SPOOLER.REC,K,0,0)
*
Use system(20)
example program
*EXAMPLE PROGRAM TO CAPTURE SPOOLER # AND VIEW IT .
* DAN WAGNER TAURUS COMPUTER GROUP 800-466-4713
* E Syracuse NY 13057
sp.cmd=\sp-assign f33 hs \
* puts spool job in hold file which is PEQS file on D3 systems
crt @(-1):" example program to get spooler no and view peqs no "
crt @(0,13):sp.cmd
execute sp.cmd
*
crt "NOW PRINTING REPORT "
*
printer on
print " this is a test "
for i = 1 to 43
pline = i 'r#2':" test line "
print pline
next i
print str('-',79)
print " finished @ ":oconv(time(),'mth') :" ":oconv(date(),'d4/')
*
printer off
printer close
spjob.no=system(20)
*
* can now show hold spjob.no using d3 VIEW command
crt @(0,19):" report printed now ready to VIEW PEQS ":spjob.no:"
Press <RTN> ":;input xans
* ex.cmd=\edit peqs \:spjob.no
ex.cm= \VIEW PEQS \:SPJOB.NO
execute ex.cmd
CRT " BACK TO PROGRAM , PRESS <RTN> ";;INPUT XANS
STOP
*END OF PROGRAM
Dan Wagner