The initial AXRCMD call only returns the primary command responses.
Secondary command responses are not returned unless there are subsequent
AXRCMD calls with the command text omitted. Here's an example showing what
you need to do:

ARG InCmdText      /* Retrieve command to be issued.                 */ 
AxrCmdRc = AXRCMD(InCmdText,Msg.,4)                                     
IF AxrCmdRc = 0 THEN                                                    
  DO             /* Write primary result to console using AXRMLWTO   */ 
    ConnectId = 'FirstLine'                                             
    call AXRMLWTO '  ','ConnectId','L'                                  
    call AXRMLWTO '*--- Start Command Output ---*','ConnectId','D'      
    call AXRMLWTO '*--- Primary Response ---*','ConnectId','D'          
    call AXRMLWTO '  ','ConnectId','D'                                  
    DO I = 1 TO Msg.0                                                   
      call AXRMLWTO Msg.i,'ConnectId','D'                               
    END                                                                 
    call AXRMLWTO '  ','ConnectId','D'                                  
  end                                                                   
else                                                                    
  do                                                                    
    say 'Command Delayed.. Retry Later'                                 
    exit AxrCmdRc                                                       
  end                                                                   
/* --- Check for up to 30 secondary command responses             --- */
    call AXRMLWTO '*--- Secondary Response ---*','connectid','d'        
    call AXRMLWTO '  ','ConnectId','D'                                  
do 30          /* Write secondary result to console using AXRWTO     */ 
SCmdRespRc = axrcmd(,msg.,5)                                            
If SCmdRespRC = 0 then                                                  
  do i = 1 to msg.0                                                     
    call AXRMLWTO Msg.i,'ConnectId','D'                                 
  end                                                                   
else Leave                                                              
end                                                                     
call AXRMLWTO '  ','ConnectId','D'                                      
call AXRMLWTO '*--- End Command Output ---*','connectid','de'           
EXIT AxrCmdRc                                                           

Regards...Ron Northrup

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to