× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a job that needs to run every few minutes. Instead of bothering
with over 200 job schedule entries I wrote one CL job that's scheduled
to run at 5 past midnight every night. It puts the job on the job queue
239 times or so (depending on the required interval).

Data area . . . . . . . : CIMOUTDA
Text . . . . . . . . . : cimoutx/x1 schedule skip times
(this data area contains start and end times of the daily backup. The
jobs are not scheduled during these times so as not to try to access
locked files)
Value
Offset *...+....1....+....2....+....3....+....4....+....5
0 '*SUN05450630*MON05450630*TUE05450630*WED05450630*T'
50 'HU05450630*FRI05450630*SAT00000210'
/*+
CimOutScd +
August 2001 Michael Steigman, VMH +
+
this job is scheduled as daily in ScdJobE(ntries) for 00:01. +
it schedules the CimOut jobs. +
+
refresh of CIM data in folders: +
jobs scheduled in JobQ Qbqbatch - +
for SFD (CimOutx) - every six minutes +
for QA (CimOutx1) - every twenty minutes +
+
14 Jan 2003 Michael Steigman +
CLP uses external dtaara, vmhlib/cimoutda to enable convenient +
modification of skip times by dayofweek without recompiling. +
+
24 Oct 2004 Michael Steigman +
QA is now directly updated from Access application in the QA +
area. The SFDinQAx process collects QA data only - not DE. +
So from now on it will not be scheduled. +
Pgm

Dcl &dayofweek *Char 4
Dcl &time *Char 6
Dcl &exctime *Char 6
Dcl &begskp *Char 6
Dcl &endskp *Char 6
Dcl &minute *Char 2
Dcl &hour *Char 2
Dcl &minctr *Dec 2
Dcl &hrctr *Dec 2
Dcl &now *Char 8
Dcl &skip_array *Char 84
Dcl &pos *Dec 4
Dcl &Xinzval *Dec 2 Value(4)
Dcl &Xincval *Dec 2 Value(6) /* for job #1 at 6 minute
intervals */
Dcl &X1inzval *Dec 2 Value(1)
Dcl &X1incval *Dec 2 Value(20) /* for job #2 at 20
minute intervals */
RtvSysVal SysVal(QDAYOFWEEK) RtnVar(&dayofweek)
RtvSysVal SysVal(QTIME) RtnVar(&now)
ChgVar &exctime %sst(&now 1 6)
ChgVar &hour %sst(&now 1 2)
ChgVar &hrctr &hour /* inz hrctr */
ChgVar &minute %sst(&now 3 2)
ChgVar &minctr &minute /* inz minctr */

/* load skip time dtaara and determine skip times by dayofweek */
RtvDtaAra cimoutda &skip_array
ChgVar &pos 1
skipLoop:
If (&dayofweek *EQ %SST(&skip_array &pos 4)) Then(+
GoTo found_skip )
Else ( Do )
ChgVar &pos (&pos + 12)
If (&pos *GT 73) Then( GoTo AbEnd1 )
GoTo skipLoop
EndDo
found_skip:
ChgVar &pos (&pos + 4)
ChgVar &begskp (%SST(&skip_array &pos 4) || '00')
ChgVar &pos (&pos + 4)
ChgVar &endskp (%SST(&skip_array &pos 4) || '00')

hrLoop:
ChgVar &hour &hrctr

/* section for hourly QA test results collection */
/* as of 24/10/2004 QA result collection will not be performed +
ChgVar &time (&hour *Cat &minute *Cat '45') +
If (&time > &exctime *AND + +
(&time < &begskp *OR &time > &endskp)) Then( +
SbmJob Cmd(Call Pgm(SFDinQAx)) +
Job(QA_rslts) +
JobQ(Qgpl/Qbatch) +
ScdTime(&time) +
MsgQ(*None) ) */

/* for first cycle x1 loop . . . */
ChgVar &minctr &X1inzval
x1Loop:
ChgVar &minute &minctr
ChgVar &time (&hour *Cat &minute *Cat '00')

If (&time > &exctime *AND +
(&time < &begskp *OR &time > &endskp)) Then( +
SbmJob Cmd(Call Pgm(CIMOUTX1)) +
Job(CIMOUTX1) +
JobQ(Qgpl/Qbatch) +
ScdTime(&time) +
MsgQ(*None) )

ChgVar &minctr (&minctr + &x1incval)

If (&minctr *LT 60) Then(Goto x1Loop)


/* for first cycle x loop . . . */
ChgVar &minctr &Xinzval
xLoop:
ChgVar &minute &minctr
ChgVar &time (&hour *Cat &minute *Cat '00')

If (&time > &exctime *AND +
(&time < &begskp *OR &time > &endskp)) Then( +
SbmJob Cmd(Call Pgm(CIMOUTX)) +
Job(CIMOUTX) +
JobQ(Qgpl/Qbatch) +
ScdTime(&time) +
MsgQ(*None) )

ChgVar &minctr (&minctr + &xincval)

If (&minctr *LT 60) Then(Goto xLoop)

ChgVar &hrctr (&hrctr + 1)

If (&hrctr *LT 24) Then(Goto hrLoop)

Return /* normal end */

AbEnd1:
SndMsg Msg('cimoutscd: Did not find dayofweek in skip time +
array') +
ToMsgQ(vmhlib/michaeloq)

EndPgm


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.