Example: Retrieve QTIME system value

In this example, QTIME is received and moved to a variable, which is then compared with another variable.

      PGM
      DCL  VAR(&PWRDNTME)  TYPE(*CHAR)  LEN(6)  VALUE('162500')
      DCL  VAR(&TIME)  TYPE(*CHAR)  LEN(6)
      RTVSYSVAL  SYSVAL(QTIME)  RTNVAR(&TIME)
      IF  (&TIME *GT &PWRDNTME)  THEN(DO)
      SNDBRKMSG('Powering down in 5 minutes.  Please sign off.')
      PWRDWNSYS  OPTION(*CNTRLD)  DELAY(300)  RESTART(*NO)  +
               IPLSRC(*PANEL)
 
      ENDDO
      ENDPGM
Related information
System values