%META:TOPICINFO{author="ChrisBartram" date="1170380556" format="1.1" version="1.2"}% %META:TOPICPARENT{name="HP3000OperatingSystemQuestions"}% ---+ How can an HP3000 Job find its own $STDLIST Spoolfile Number (ofid) Note; on MPE/iX 5.5 PP5 and later, all you have to do is reference the HPSPOOLID CI variable --[[JeffVance]] The following command file, provided by [[JeffVance]], 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-- Main.ChrisBartram - 18 May 2006