HP3000-L Archives

July 2008, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Paul Taffel <[log in to unmask]>
Reply To:
Paul Taffel <[log in to unmask]>
Date:
Tue, 1 Jul 2008 17:02:42 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (153 lines)
Here's an MPE command file that will display job stdlists, and will
update every 2 seconds if the stdlist is growing.

Cut and paste the commands at the end of this email into a file named
PRINTO.

You can then type

    :PRINTO

to see the last job you streamed

or

   :PRINTO #Jxxx

to see an arbitrary job stdlist (assuming you have necessary capabilities).

Hit <Return> to exit the command before the job terminates.

The innards of the command file are complex, and work-around some end
conditions I've come across over the years.

Hope this helps,

Paul Taffel



=====================================================
Everything after this line is the PRINTO command file:



parm Jid=''; nest='0'; delay=2
anyparm rest=!['']
# PRINTO script, Paul Taffel.  Release 2007-10-10.
if '!hpfile'=''
   # Work-around Qedit bug: hpfile can be empty
   setvar _hpfile finfo ('printo','fullfname')
else
   setvar _hpfile hpfile
endif
if (not numeric('!nest')) or !nest=0
    if hpinbreak
      echo Error!  Can't PRINTO when in !<Break!> state
      return
    endif
    setvar _savelastjob hplastjob
    setvar _Jid  ups('!Jid' )
    setvar _rest ups('!rest')
    setvar _nest ups('!nest')
    if numeric(str(_Jid,1,1))
      setvar _Jid '#J'+_jid
    elseif str(_Jid,1,1)='J'
      setvar _jid '#'+_jid
    endif
    if '!_nest'<>'0' and '!_nest'<>'1'
      setvar _rest _nest
      setvar _nest '0'
    endif
    if _jid=''
      setvar _jid hplastjob
    endif
    if _rest<>''
      setvar _rest ';rest='+_rest
    endif
    if _jid=''
      Echo Error!  No last job
      deletevar _savelastjob
      return
    endif
    setvar hplastjob _Jid
    setvar _hplastspid hplastspid
    if '!_hplastspid'=''
      file lastjob=lastjob.pub.sys,oldtemp
      if finfo ('*lastjob','exists')
        purge *lastjob
      endif
      build lastjob.pub.sys;temp;msg;rec=-80,,v,ascii;nocctl
      showout sp;job=!hplastjob >*lastjob
      if finfo('*lastjob','eof') > 2
        input _out < *lastjob
        input _out < *lastjob
        input _out < *lastjob
        setvar _hplastspid word ('!_out',,2) -'#'
      endif
      purge *lastjob
      reset lastjob
    endif
    if '!_hplastspid'=''
      echo Job !hplastjob $STDLIST unavailable
      setvar hplastjob _savelastjob
      return
    endif
    setvar _hplastjob hplastjob
    file f=!_hplastspid.out.hpspool; cctl; nomulti
    setvar hplastjob _savelastjob
    deletevar _savelastjob
else
    setvar _nest '!nest'
endif
if _nest='0'
    # Run 1st son CI.  Opens job STDLIST as $STDIN, lets
    # us read to eof even when SET STDLIST=DELETE.
    xeq ci.pub.sys<*f>$NULL;parm=3;info=&
     "xeq !_hpfile jid=!_Jid;nest=1;delay=!delay!_rest"
    return
elseif _nest='1'
    # Run 2nd son CI with user terminal as $STDIN, lets
    # us pause using INPUT with timeout specified.
    file prin;dev=!hpldevin;acc=in
    file prout;dev=!hpldevlist;acc=append
    xeq ci.pub.sys<*prin>*prout;parm=3;info=&
     "xeq !_hpfile jid=!_Jid;nest=2;delay=!delay!_rest"
    return
endif
if pos('NONUM',_rest)=0 and pos('NUM',_rest)>0
    setvar _num ';NUM'
else
    setvar _num ''
endif
echo
echo ![chr(27)+'&dB']&
   $STDLIST for Job !_hplastjob (!_hplastspid.OUT.HPSPOOL):
setvar _next 1
setvar _fmod finfo('*f',-24)
while true
    if finfo('*f','accessors')<=2 or typeof(&
       setvar(hpresult,jinfo(_hplastjob,'state',cierror)))=1
      print *f;start=!_next;page=0!_num
      return
    elseif setvar(_fend, finfo('*f',19)) >= _next
      setvar _fmod finfo('*f',-24)
      print *f;start=!_next;end=!_fend;page=0!_num
      setvar _next _fend+1
    elseif finfo('*f',-24) > _fmod
      # finfo('eof') can get 'stuck' if others access the
      # same spoolfile as us.  This may have occurred;
      # the next line corrects this, for reasons unknown:
      print *f;start=1;end=0
    endif
    setvar hpcierr 0
    input _input,,![abs(!delay)],1 >$NULL
    if hpcierr<>-9003
      Echo PRINTO terminated at user request.
      return
    endif
endwhile 

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2