Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Checking for system in restricted state

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Checking for system in restricted state

    It's much easier to monitor one or all of the SUBSYSTEMS to see if they are up or down. You can issue an ENDSBS for a subsystem and monitor for the message that says it isn't running anymore. If you get the message that it is still ending, then DLYJOB and loop thru again until it's down.

  • #2
    Checking for system in restricted state

    Disclaimer: I have NOT tested this in a "restricted state" environment, but, it *should* work (at V4R4 or later). /*------------------------------------------------------------------*/ /* RTVSYSSTA - Retrieve System State using the QWCRSSTS */ /*------------------------------------------------------------------*/ PGM /* Declare all variables needed for the QWCRSSTS API */ DCL VAR(&RCVRVAR) TYPE(*CHAR) LEN(64) DCL VAR(&RCVRLEN) TYPE(*CHAR) LEN(04) DCL VAR(&ERRCODE) TYPE(*CHAR) LEN(04) DCL VAR(&RESET) TYPE(*CHAR) LEN(10) DCL VAR(&SYSSTATE) TYPE(*CHAR) LEN(01) /* Reset statistics back to zero */ CHGVAR VAR(&RESET) VALUE('*YES ') /* Use 64 byte length for receiver variable */ CHGVAR VAR(%BIN(&RCVRLEN 1 4)) VALUE(0064) /* Initialize Error Code return field */ CHGVAR VAR(&ERRCODE) VALUE(X'00000000') /* Call API to Retrieve System Status */ CALL PGM(QWCRSSTS) PARM(&RCVRVAR &RCVRLEN + 'SSTS0200' &RESET &ERRCODE) /* Extract the Restricted State Flag */ CHGVAR VAR(&SYSSTATE) VALUE(%SST(&RCVRVAR 31 1)) /* Check Restricted State Flag (0=No, 1=Yes) */ IF COND(&SYSSTATE *EQ '1') THEN(DO) SNDMSG MSG('System is in a Restricted State') + TOUSR(*SYSOPR) ENDDO ENDPGM

    Comment


    • #3
      Checking for system in restricted state

      Excellent idea. When in doubt, do it the simplest way. Thanks.

      Comment


      • #4
        Checking for system in restricted state

        I've automated our weekly backups w/a CL pgm and would like it to know when the system is in a restricted state. The only solution I can think of is to call another CL pgm that will DSPLOG to a spooled file, copy that to a PF and scan the file for the SST "restricted state". If found it returns, if not found it waits a minute or so and loops back to DSPLOG again. Surely there's a simpler way...

        Comment


        • #5
          Checking for system in restricted state

          Here's a routine we use and it works very well... ENDSBS SBS(*ALL) OPTION(*IMMED) ENDSBS: ENDSBS SBS(*ALL) OPTION(*IMMED) MONMSG MSGID(CPF1035) EXEC(DO) RCVMSG MSGTYPE(*EXCP) RMV(*YES) DLYJOB DLY(15) GOTO CMDLBL(ENDSBS) ENDDO This routine loops through the ENDSBS command until it eventually receives the CPF0936 message. At this point the system is in a restricted condition.

          Comment

          Working...
          X