I have a similar cmd file that I call JLIST. By default JLIST will
display the $STDLSIT of !HPLASTJOB, but you can also enter the job
number as a parm, and a ldev to print on, also optional. No msg file I/O
either, because of a really neat thing about these 'HPLAST' variables,
when you SETVAR HPLASTJOB to a jobnumber, then HPLASTSPID is
automagically set to that jobs $STDLIST dfid#, cool.
........................................................
Parm jobnum='#' ldev='00'
#
Setvar _jobnum '!jobnum'
If '!_jobnum' = '#' Then
Setvar _jobnum str(HPLASTJOB,3,![len(HPLASTJOB)] - 2)
Endif
Setvar hpcierr 0
Spoolf o@;seleq=[(jobnum=j!_jobnum) and (filedes=$stdlist)];show >
$null
If hpcierr > 0
Echo !hpcierrmsg
return
Endif
SETVAR HPLASTJOB '#J!_jobnum'
IF FINFO('!HPLASTSPID.OUT.HPSPOOL','EXISTS') = FALSE
echo Standard list for job #J!_jobnum doesn't exist!
return
Endif
setvar _mpecmd 'print '+'!HPLASTSPID'+'.out.hpspool'
If '!ldev' = '00'
echo !_mpecmd
!_mpecmd
Else
File jlist;dev=!ldev
!_mpecmd >*jlist
Endif
.........................................................................................
>>> modalto <[log in to unmask]> 08/15/02 07:32AM >>>
parm jobnum xtra="+"
purge ewtmp,temp
build ewtmp;disc=100;rec=-256,,v,ascii;nocctl;temp;msg
showout job=j!jobnum > ewtmp
setvar _found 0
setvar _beg 0
setvar _end 0
setvar _atend 0
setvar _afound 0
setvar _bfound 0
setvar _lastdfid 9999
while finfo("ewtmp","eof") > 0 and _found = 0 do
input _rec < ewtmp
setvar _len len("!_rec")
setvar _tmpstr pos("#O", "!_rec")
if !_tmpstr > 0
setvar _afound 1
setvar _beg ( !_tmpstr + 2 )
endif
setvar _stdlist pos("STDLIST", "!_rec")
if !_stdlist > 0
setvar _jline pos("#J", "!_rec")
setvar _bfound 1
setvar _end ( !_stdlist - !_jline )
endif
setvar _displayed pos("DISPLAYED", "!_rec")
if !_displayed > 0
setvar _atend 1
endif
if !_bfound = 1 and !_afound = 1 and !_atend = 1
setvar _found 1
endif
if !_stdlist > 0
setvar _dfid str("!_rec", !_beg, !_end)
if _lastdfid = 9999
setvar _lastdfid ( !_dfid )
else
if !_dfid > !_lastdfid
setvar _lastdfid ( !_dfid )
endif
endif
endif
endwhile
if "!xtra" = "-"
setvar _dfid ( "!_dfid" + ";-22" )
endif
if "!_dfid" <> ""
prsp !_dfid
else
echo *** Job Not Found, Probably on a wait ***
endif
deletevar _@
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|