Hi Greg,
Sorry for the late reply...
> To answer Jeff's question, we are pausing by jobname, !PAUSE
> 133;JOB="IMAILSTR,JOBS.account"
> This job is scheduled by another job that runs once an
> evening, so by end of day, this scheduled instance is already
> scheduled, and causes this pause to exceed the time specified
> (CIWARN 9032).
My first thought was to write the job number to a simple MSG file, read
the MSG file and pause by job number. E.g.
Streaming job does:
...
if not finfo('mailjobf','exists') then
build mailjobf;msg;rec=-10,,f,ascii;disc=2
endif
file mailpaus=mailjobf,old
stream imailstr.jobs.acct;in=x,y
echo !hplastjob >>*mailpaus
...
The pausing job does:
...
file mailpaus=mailjobf,old
input _pause_job <*mailpaus
pause 133;job=!_pause_job
...
Lots of room for improvement, error handling, and hang prevention (don't
want to read an empty MSG file); but this outlines the basic approach.
> So, taking Dave Powell's advice, I will try:
> SETVAR _JOBCNT JOBCNT('IMAILSTR,JOBS.account',_JOBLIST)
Presumably _jobcnt will be 0, 1 or 2.
> WHILE SETVAR(_JOBCNT,_JOBCNT - 1) > 0
Now _jobcnt is 0 or 1
> IF JINFO(WORD(_JOBLIST,,_JOBCNT),'JOBSTATE') = 'EXEC'
word('x x x',,0) = "" and jinfo("",'jobstate') is an error.
^
> PAUSE JOB=![WORD(_JOBLIST,,_JOBCNT)]
> ENDIF
> ENDWHILE
>
> If there's a better way, I'm all ears.
Here's how I'd use this approach -- NOT TESTED!
setvar jcnt jobcnt('imailstr,jobs.acct',jlist)
if jcnt = 0 then
echo something brillant here!
escape
endif
if jcnt > 2 then
echo more here
escape
endif
# jlist contains 1 or two jobs, we will pause on the EXEC job
setvar j 0
while setvar(j,j+1) <= jcnt do
if jinfo(setvar(job,word(jlist,,jcnt)),'executing') then
pause 133;!job
endif
endwhile
HTH,
Jeff Vance, vCSY
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|