tail on a stdlist - Hewlett Packard

This is a discussion on tail on a stdlist - Hewlett Packard ; We have a job that fields transactions sent to a data set, and updates them, logging msgs that can be useful sometimes. I have tried to use tail -f inposix on the outspool, but I get a 'permission denied' msg. ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: tail on a stdlist

  1. tail on a stdlist

    We have a job that fields transactions sent to a data set, and updates them, logging msgs that can be useful sometimes. I have tried to use tail -f inposix on the outspool, but I get a 'permission denied' msg. I am not the user in the job, but even logged on as manager.sys I get the same error.
    Anybody know a way to make this work please?

    tks
    jp

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


  2. Re: tail on a stdlist

    Try:

    rint ONNNN.OUT.HPSPOOL;START=-nnnn

    where ONNNN is the spoolfile id and nnnn is the number of record you
    want to see counting from the end of the file.


    regards,

    Robert W.Mills
    Business Systems Development Analyst
    Group Information Systems & Technology
    Pinnacle Entertainment
    DDI: +44 (0)20 8309 3604


    -----Original Message-----
    From: HP-3000 Systems Discussion [mailto:HP3000-L@RAVEN.UTC.EDU] On
    Behalf Of John Pitman
    Sent: 01 July 2008 08:54
    To: HP3000-L@RAVEN.UTC.EDU
    Subject: [HP3000-L] tail on a stdlist

    We have a job that fields transactions sent to a data set, and updates
    them, logging msgs that can be useful sometimes. I have tried to use
    tail -f in posix on the outspool, but I get a 'permission denied' msg. I
    am not the user in the job, but even logged on as manager.sys I get the
    same error.
    Anybody know a way to make this work please?

    tks
    jp

    * 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 *


  3. Re: tail on a stdlist

    Robert,
    I am a specifically after a way to start a tail -f on a stdlist file, and leave it there so the user can watch transactions being updated as they arrive.

    jp

    -----Original Message-----
    From: Robert Mills [mailto:robert.mills@pinnacle-entertainment.co.uk]
    Sent: Tuesday, 1 July 2008 8:09 PM
    To: John Pitman; HP3000-L@RAVEN.UTC.EDU
    Subject: RE: [HP3000-L] tail on a stdlist

    Try:

    rint ONNNN.OUT.HPSPOOL;START=-nnnn

    where ONNNN is the spoolfile id and nnnn is the number of record you
    want to see counting from the end of the file.


    regards,

    Robert W.Mills
    Business Systems Development Analyst
    Group Information Systems & Technology
    Pinnacle Entertainment
    DDI: +44 (0)20 8309 3604


    -----Original Message-----
    From: HP-3000 Systems Discussion [mailto:HP3000-L@RAVEN.UTC.EDU] On
    Behalf Of John Pitman
    Sent: 01 July 2008 08:54
    To: HP3000-L@RAVEN.UTC.EDU
    Subject: [HP3000-L] tail on a stdlist

    We have a job that fields transactions sent to a data set, and updates
    them, logging msgs that can be useful sometimes. I have tried to use
    tail -f in posix on the outspool, but I get a 'permission denied' msg. I
    am not the user in the job, but even logged on as manager.sys I get the
    same error.
    Anybody know a way to make this work please?

    tks
    jp

    * 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 *


  4. Re: tail on a stdlist

    I wrote a script that sorta does what you're asking....

    I'd find the spoolfile I was after (which was in a create state)....read it
    until eof....wait for a minute...and then read again...processing any new
    records.

    sounds pretty easy...except that there's a problem with trying to read until
    eof on active spoolfiles. you'll sometimes get cierr 900. which (according
    to hp) is just how it is. spoolfiles may look normal...but they're really
    not. (does that mean they're abnormal? :-)

    trying to script around it wasn't too bad. just one of those 'gotchas' that
    you need to now about. - d

    ---
    Donna Hofmeister
    Allegro Consultants, Inc.
    408-252-2330


    > -----Original Message-----
    > From: HP-3000 Systems Discussion [mailto:HP3000-L@RAVEN.UTC.EDU] On
    > Behalf Of John Pitman
    > Sent: Tuesday, July 01, 2008 3:35 PM
    > To: HP3000-L@RAVEN.UTC.EDU
    > Subject: Re: [HP3000-L] tail on a stdlist
    >
    > Robert,
    > I am a specifically after a way to start a tail -f on a stdlist file,
    > and leave it there so the user can watch transactions being updated as
    > they arrive.
    >
    > jp
    >
    > -----Original Message-----
    > From: Robert Mills [mailto:robert.mills@pinnacle-entertainment.co.uk]
    > Sent: Tuesday, 1 July 2008 8:09 PM
    > To: John Pitman; HP3000-L@RAVEN.UTC.EDU
    > Subject: RE: [HP3000-L] tail on a stdlist
    >
    > Try:
    >
    > rint ONNNN.OUT.HPSPOOL;START=-nnnn
    >
    > where ONNNN is the spoolfile id and nnnn is the number of record you
    > want to see counting from the end of the file.
    >
    >
    > regards,
    >
    > Robert W.Mills
    > Business Systems Development Analyst
    > Group Information Systems & Technology
    > Pinnacle Entertainment
    > DDI: +44 (0)20 8309 3604
    >
    >
    > -----Original Message-----
    > From: HP-3000 Systems Discussion [mailto:HP3000-L@RAVEN.UTC.EDU] On
    > Behalf Of John Pitman
    > Sent: 01 July 2008 08:54
    > To: HP3000-L@RAVEN.UTC.EDU
    > Subject: [HP3000-L] tail on a stdlist
    >
    > We have a job that fields transactions sent to a data set, and updates
    > them, logging msgs that can be useful sometimes. I have tried to use
    > tail -f in posix on the outspool, but I get a 'permission denied' msg.
    > I
    > am not the user in the job, but even logged on as manager.sys I get
    > the
    > same error.
    > Anybody know a way to make this work please?
    >
    > tks
    > jp
    >
    > * 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 *


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


  5. Re: tail on a stdlist

    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 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 ! 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 *


  6. Re: tail on a stdlist

    ******** SNIP *************
    Subject: [HP3000-L] tail on a stdlist

    We have a job that fields transactions sent to a data set, and updates them,
    logging msgs that can be useful sometimes. I have tried to use tail -f in
    posix on the outspool, but I get a 'permission denied' msg. I am not the
    user in the job, but even logged on as manager.sys I get the same error.
    Anybody know a way to make this work please?

    *************************

    Here is a command file I wrote a while back. It will print what is in the
    file then monitor the spool file for you and output new lines as they appear
    in the file. You can modify it to start at the end of the file with another
    parm. It was created to duplicate the NBSPOOL list while functionality. I
    had some systems without NBSPOOL and I liked that feature so I wrote it. It
    accepts a job number or OFID or if nothing is passed it will use the
    $STDLIST from the last job you streamed. Second parm is lines per page and
    the third is whether to continue looking for new lines when EOF is reached.
    It is also MPEX aware.

    parm id='!hplastjob',lines=0,cont="Y"
    setvar rec1 1
    setvar rec2 1
    setvar _lines 'page=!lines'
    setvar _cont ups("!cont")

    if lft(hpjobname,2)<>'SM'
    setvar _lines 'page=24'
    else
    setvar _lines 'page=!lines'
    endif

    if lft('!id',2)='#J'
    setvar txtw '!hplastspid.out.hpspool'
    file txtw=!hplastspid.out.hpspool,old
    elseif ups(lft('!id',1))='O'
    setvar txtw '!id.out.hpspool'
    file txtw=!id.out.hpspool,old
    else
    setvar hplastjob '#J!id'
    setvar txtw '!hplastspid.out.hpspool'
    file txtw=!hplastspid.out.hpspool,old
    endif

    if insidempex=1
    setvar cmdopen "vefinfo('*txtw').opened"
    else
    setvar cmdopen "finfo('*txtw','accessors')>0"
    endif

    if finfo('*txtw','exists')
    setvar rec1 finfo('*txtw','eof')+1
    else
    echo ERROR: File !hplastspid.out.hpspool does not exist!
    return
    endif

    while (!cmdopen or rec2<>rec1) and &
    ups(_cont)='Y'
    if rec1<>rec2
    if insidempex=1
    print !txtw;start=![rec2+1];end=!rec1;!_lines
    else
    print *txtw;start=![rec2+1];end=!rec1;!_lines
    endif
    setvar _lines 'page=0'
    setvar rec2 rec1
    else
    input _cont,,3 > $null
    endif
    if insidempex=1
    print !txtw;start=1;end=1 > $null
    else
    print *txtw;start=1;end=1 > $null
    endif
    setvar rec1 finfo('*txtw','eof')
    endwhile

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


+ Reply to Thread