How can I store an RPG program in memory?

I encoded a monitoring program in an RPG that checks if the fax / 400 is working.

And now I want this program to be checked every 15 minutes.

Instead of placing the task every 15 minutes in the task scheduler (which would be ugly to manage), I made the program wait between checks with DLYJOB.

Now, how can I get this program to "put itself" into memory so that it continues to work?

(I was thinking about using SBMJOB, but I can’t determine in which order of jobs I could place it.)

+3
source share
3 answers

QSYSNOMAX. .

QSTRTUP, .

+2

. .

  • , DLYJOB .
  • .

Monitor MSGW, :

         PGM     
         DCL        VAR(&TIME) TYPE(*CHAR) LEN(6)
         DCL        VAR(&STOPTIME) TYPE(*CHAR) LEN(6) +
                      VALUE('200000')   
         /* Setup my program (run only once) */
START:
         /* Perform my actions */

         RTVSYSVAL  SYSVAL(QTIME)  RTNVAR(&TIME)
         IF         COND(&TIME *GE &STOPTIME) THEN(GOTO CMDLBL(END))
         DLYJOB     DLY(180)
         GOTO       CMDLBL(START)
END:
         ENDPGM

8:00 . .

jobq. QINTER, . , , .

QINTER, 100% , .

+2

.

1), , , , .
2) OVRDBF cmd, parm, , EOF, pgm .
3) sbmjob pgm, , , DOW 1 = 1, . , , , .

+2

Source: https://habr.com/ru/post/1770793/


All Articles