NOWOK

/*-------------------------------------------------------------------*/
/* Procedure Name: NOWOK                                             */
/* Used by: NETVCTRL, TSOCTRL                                        */
/* Called or executed from: AMONNETV, AMONTSO                        */
/*                                                                   */
/* The procedure "nowok" is called whenever the controlling LU has   */
/* previously seen one of its monitoring LUs as inactive, but now    */
/* sees it has regained activity.  It's "now okay", hence the name.  */
/* The controlling LU calling this procedure passes it two           */
/* parameters: the terminal type (via "termtype") and the amount of  */
/* time the controlling LU should wait before returning to the       */
/* procedure "amonnetv" or "amontso".                                */
/*-------------------------------------------------------------------*/

nowok:     msgtxt
           /*--------------------------------------------------------*/
           /* A select group is used to determine what kind of       */
           /* terminal type is now okay.  When the condition is      */
           /* met, the system availability counter is incremented    */
           /* by the 3 minutes that have expired, the "still-active" */
           /* switch is turned off, and a special message is issued. */
           /* The LU is then suspended for the period of time        */
           /* specified in the parameter passed to this procedure.   */
           /*--------------------------------------------------------*/
           select
            when termtype='netview' |,
                 termtype='NetView' |,
                 termtype='NETVIEW' then
             do
              /*-----------------------------------------------------*/
              /* NetView terminal now okay                           */
              /*-----------------------------------------------------*/
              netview_availability=netview_availability+3
              netview_still_active=off
              call reftime
              temp='NetView term',
                   id_token,
                   'responding again',
                   time_of_day
              queue=queue||hex(length(temp),2)||temp
             end

            when termtype='tso' | termtype='TSO' then
             do
              /*-----------------------------------------------------*/
              /* TSO terminal now okay                               */
              /*-----------------------------------------------------*/
              tso_availability=tso_availability+3
              tso_still_active=off
              call reftime
              temp='TSO term' id_token 'responding again',
                   time_of_day
              queue=queue||hex(length(temp),2)||temp
             end

            otherwise
             do
              /*-----------------------------------------------------*/
              /* Terminal type now known to this procedure           */
              /*-----------------------------------------------------*/
              temp='Undefined NOWOK termtype:' termtype
              queue=queue||hex(length(temp),2)||temp
             end
            end
           signal 'SPECMSG'
           suspend(terminal_suspend_time)
           return
           endtxt