GETMSG - Console Messages einlesen

REXX TSO und MVS Built-In Funktionen

Syntax:                                 
CONSOLE ACTIVATE <NAME(userid)> <CART(cons_resp_tok)>
GETMSG(var<,<typ>,<cart>,<mask>,<time>>)
typ = "SOL"/"UNSOL"/"EITHER"
RC = 0 = OK
RC = 4 = no msg / time
RC = 8 = Attention PA1
CONSOLE DEACTIVATE

/* REXX GETMSG Copyright YCOS Yves Colliard Software 1990-2009 */
/* TRACE ?R  */
  /* einschalten des interaktiven Trace Modus */
  /* */
/* User need CONSOLE Authority - TSOAUTH - ALTER */
  /* */
crt = "YVES001"
"CONSOLE ACTIVATE NAME(YVES),", /* Activate Console Processing     */
                 "CART("crt")"
               /* Name default my Userid - Take care SDSF...       */
               /* CART is used in GETMSG to get only my ones       */

               /* Set Console Defaults */
"CONSPROF SOLDISP(NO) SOLNUM(500) UNSOLDISP(NO)",
     "UNSOLNUM(100)"

ADDRESS CONSOLE "D A,L"         /* Display all Address Spaces      */

resp = GETMSG("ycos.","SOL",crt,,10)
                                /* Messages mind. 10 Sek. abwarten */
  /* */
IF resp = 0 THEN                /* Messages angekommen             */
   DO ind=1 TO ycos.0
      SAY ycos.ind              /* Ausgabe                         */
   END
ELSE DO
   SAY "Error GETMSG, RC = "resp
   SELECT
   WHEN resp = 4 THEN do
     SAY "Keine Meldung oder"
     SAY "Keine Meldung stimmt mit der Auswahl oder"
     SAY "Zeit uberschritten"
   END
   WHEN resp = 8 THEN do
     SAY "Attention - PA1"
   END
   WHEN resp = 12 THEN do
     SAY "CONSOLE nicht aktiv"
   END
   WHEN resp = 16 THEN do
     SAY "CONSOLE deaktiviert"
   END
   OTHERWISE
     SAY "Unbekannt"
   END
END
  /* */
"CONSOLE DEACTIVATE"            /* Deactivate Console Processing   */