Hi 

 

I have been trying to figure out my problem but I cannot seem to find it
so I thought maybe someone more experience at this could help.

 

Here is my current issue (I am sure there will be more to come but for
now!) when I do a SAY and try to PULL the ANSWER I keep getting what
appears to be left over messages not the expected data. The piece of
code in RED is where I am having the problem. Keep in mind that I am
just testing certain things out to get familiar with this so the code is
my no means what I hope to end up with.

 

When I PULL the REPLY it is a message and therefore my check for the
answer never works. It is like something is left on the STACK. I am
thinking it has something to do with the 'WAKEUP +0 (IUCVMSG QUIET' .  I
say this because when I put the code in RED above this the REPLY area is
what I expect not a message.  

 

Do I need to clear something? Thanks for the help in advance.   

 

 

/*  LINUX SHUTDOWN EXEC */                

 /*                                        

 TRACE i                                   

 SAY 'TO STOP LINUX GUESTS ENTER'          

 SAY 'ALL'                                 

 SAY 'OR'                                  

 SAY 'LINUX GUEST ID'                      

 PULL GUEST                                

                                           

 IF GUEST /= 'ALL' THEN                    

   DO                                      

    SAY 'SHUTING DOWN' GUEST 'GUEST CHOOSE:

    SAY 'REIPL'                            

    SAY ' OR'                              

    SAY 'SHUTDOWN'                         

                                           

    PULL FUNCTION                          

                                           

    'WAKEUP +0 (IUCVMSG QUIET'      

 

  /*'CP SIG SHUTDOWN' GUEST 'WITHIN 180'    WAIT 3 MINUTE THEN FORCE */

                                                                       

    end                                                                

  /*  IF RC=45 THEN*/                                                  

  /*EXIT */                                                            

  SAY '... WAITING FOR SHUTDOWN COMPLETION'                            

                                                                       

DO FOREVER;               /* WILL GET MESSAGES UNTIL GUEST DOWN */     

'WAKEUP (IUCVMSG QUIET'            /*   MESSAGE HAS ARRIVED */         

                                                                       

IF RC = 6 THEN                                                         

  DO                                                                   

  IF FUNCTION = 'SHUTDOWN' THEN                                        

   DO                                                                  

    SAY GUEST 'VM USER LOGGING OFF'                                    

    'CP SEND CP' GUEST 'LOGOFF'                                        

  END                                                                  

        DO                                                             

       'PIPE CP Q NAMES | LOCATE /'GUEST'/ | SPLIT | LOCATE /'GUEST'/',

          '| > LINUX USERS A'   

 

                                                                    

            USERID = 'LINUX USERS A'                                

       PARSE VALUE STREAM(USERID,'C','OPEN READ') WITH OK FILE_HANDL

   end                                                              

                                                                    

      IF OK /= 'READY:' THEN                                        

  DO                                                                

    SAY 'LINUX USER HAS BEEN LOGGED OFF'                            

    end                                                             

   DO                                                               

     SAY 'DO YOU WANT TO LOG' GUEST 'BACK ON'                       

     SAY 'YES'                                                      

     SAY ' OR'                                                      

     SAY 'NO'                                                       

       PULL REPLY                                                   

      IF REPLY /= 'YES' THEN                                        

       EXIT                                                         

       END                                                          

    DO                                                              

     'PIPE CP XAUTOLOG' GUEST  

 

      'PIPE CP XAUTOLOG' GUEST


      SAY GUEST 'HAS BEEN LOGGED ON'


 


     IF FUNCTION = 'REIPL' THEN


      DO


       SAY GUEST 'VM USER REIPL STARTED'


       'CP SEND CP' GUEST 'IPL 700 CLEAR'


       END


     'CP I CMS'


      EXIT


    END


    END


 END  /* END OF DO FOREVER LOOP */


 


 /* =================== END OF INDIVIDUAL GUEST SHUTDOWN ============ */


 


     EXIT          /* RETURN TO CMS */


 


Reply via email to