HP30003k Associates LogoHP3000/HP 3000 FAQ

Last Updated: Thursday, February 01, 2007 02:38 PM

HP3000 FAQ
MPE/V

HPe3000 FAQ
MPE/XL

HP 3000 FAQ
MPE/iX


How can an HP3000 job find it's own $STDLIST spoolfile number?

3.15. How can a job find it's own $STDLIST spoolfile number?

Note; on MPE/iX 5.5 PP5 and later, all you have to do is reference the HPSPOOLID CI variable (Jeff Vance).

The following command file, provided by Jeff Vance, returns the spoolfile ID for the $STDLIST of whatever job or session you pass it (for earlier MPE/iX versions):

PARM jobnum=!hplastjob, rtnvar=spid, entry=main
# (This command file assumes Express 3 release, if you are not on Express 3
# then change all '#' to 'comment' and change '!hplastjob' to ''.)
#
# This command file returns the spoolfile id (Onnnnnnn) in the CI variable
# named in the "rtnvar" parm. To reference this file you may need to
# append ".OUT.HPSPOOL" to the value in "rtn_parm". Example:
# :jobspid #J123 spid
# :print !!spid.out.hpspool
#
if '!entry' = 'main' then
# main entry, redirect output of :listspf
errclear
setvar !rtnvar ''
# could syntax check jobnum parm here...
listspf O@;seleq=[JOBNUM=!jobnum AND FILEDES=$stdlist] >./jobspid_tmp
if hpcierr <> 0 then
# listspf couldn't find job
echo !jobnum not found.
escape
else
xeq !hpfile !jobnum, !rtnvar, entry=parse_listspf <./jobspid_tmp
deletevar _jobspid_@
return
endif 
elseif '!entry' = 'parse_listspf' then
# listspf input has been redirected to TEMP file ./jobspid_tmp
# throw away 1st 3 lines.
input _jobspid_rec
input _jobspid_rec
input _jobspid_rec
setvar !rtnvar rtrim(str(input(),2,8))
return
endif

Back to FAQ Index Back to 3k Home Page
 
HP3000-L FAQ Collection (c) 3k Associates, Inc. 1996-2006