Greg,
How about taking the easy way out and suppressing the errors. See below:
I also removed some of the ('!_stringvar') constructs, since they are not
really needed in functions that expect string variables.
BTW. You could choose different values for 'hpmsgfence' (there are 9
different values) to suppress different aspects of the error messages.
"Help hpmsgfence all" should provide you with a complete list.
Regards
Paul Christidis
=====================
ANYPARM _ANYPARM=AOS #!HPJOBTYPE!HPJOBNUM !HPJOBNAME !HPSPOOLID
SETVAR _TEMPSTRING ANYPARM(!_ANYPARM)
SETVAR _LIST WORD(_TEMPSTRING,,1)
SETVAR _MSG XWORD(_TEMPSTRING,,1)
IF _MSG = ""
SETVAR _MSG "!HPJOBNAME #!HPJOBTYPE!HPJOBNUM !HPSPOOLID"
ENDIF
setvar _HldFence hpmsgfence
setvar hpmsgfence 2
IF POS('A',UPS(_LIST)) > 0
TELL MGR.!HPACCOUNT !_MSG
ENDIF
IF POS('O',UPS(_LIST)) > 0
TELLOP !_MSG
ENDIF
IF POS('S',UPS(_LIST)) > 0
IF STR(HPSTREAMEDBY, ![(POS('#',HPSTREAMEDBY)+1)],1) = 'S'
IF HPJOBTYPE = 'J'
TELL ![WORD(HPSTREAMEDBY, ,3)] !_MSG
ELSE
ECHO !_MSG
ENDIF
ENDIF
ENDIF
IF HPCMDTRACE = FALSE
DELETEVAR _TEMPSTRING,_LIST,_MSG
ELSE
SHOWVAR _TEMPSTRING,_LIST,_MSG
ENDIF
setvar hpmsgfence _HldFence
==============================
HP-3000 Systems Discussion <[log in to unmask]> wrote on 03/11/2005
03:46:14 PM:
> I noticed that some of our jobs issue TELLs and TELLOPs that are
identical.
> Also, these TELLs tend not to bother with any kind of basic error
> prevention.
> So, STDLists are cluttered with multiple occurrence of the same message
to
> different recipients, and various inconsequential errors, such as the
target
> being another job, or a quiet session, or there being no such session.
So,
> it occurred to me to try to provide a single command file to manage
TELLs to
> any combination of the console operator, the account manager, and
whoever
> actually streamed the job when we don't want to annoy others signed on
as
> account manager. Here is what I have so far:
> ANYPARM _ANYPARM=AOS #!HPJOBTYPE!HPJOBNUM !HPJOBNAME !HPSPOOLID
> SETVAR _TEMPSTRING ANYPARM(!_ANYPARM)
> SETVAR _LIST WORD('!_TEMPSTRING',,1)
> SETVAR _MSG XWORD('!_TEMPSTRING',,1)
> IF _MSG = ""
> SETVAR _MSG "!HPJOBNAME #!HPJOBTYPE!HPJOBNUM !HPSPOOLID"
> ENDIF
> IF POS('A',UPS(_LIST)) > 0
> IF JOBCNT('MGR.!HPACCOUNT') > 1
> TELL MGR.!HPACCOUNT !_MSG
> ENDIF
> ENDIF
> IF POS('O',UPS(_LIST)) > 0
> TELLOP !_MSG
> ENDIF
> IF POS('S',UPS(_LIST)) > 0
> IF STR('!HPSTREAMEDBY',![(POS('#','!HPSTREAMEDBY')+1)],1)= 'S'
> IF HPJOBTYPE = 'J'
> TELL ![WORD('!HPSTREAMEDBY',,3)] !_MSG
> ELSE
> ECHO !_MSG
> ENDIF
> ENDIF
> ENDIF
> IF HPCMDTRACE = FALSE
> DELETEVAR _TEMPSTRING,_LIST,_MSG
> ELSE
> SHOWVAR _TEMPSTRING,_LIST,_MSG
> ENDIF
>
> I know that I want to add a check before the first TELL for actual
users, to
> avoid that error. While jobcnt can tell me how many there are, how can I
> tell if they will in fact receive such a message? Perhaps those errors
are
> unavoidable, short of building and parsing my own list of such users.
>
> And one nicety I could not come up with is a way to not bother with the
> first word of the parm. I would need to test that first word for any of
the
> three expected values, but only some combination of those three. And a
> simple test for their existence when optional might fail on a first word
> containing anyone of those three letters. If I could sum up the number
of
> times each letter occurs once, and compare that to the length, that
should
> work (assuming messages do not begin with As, OS, So or SOA). But I
don't
> see a simple way to get the number of times each letter occurs once. I
could
> set a variable to the first word, test it for the existence of each
letter,
> and when found, substitute some token for each letter, then test for a
> string of just those tokens. That seems awfully involved. But maybe parm
> processing has to be.
>
> Suggestions for improvements welcome. Once again, I suspect I am working
on
> a problem that others have already solved.
>
> Greg Stigers
>
> * 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 *
|