Skip to content

Sample REXX EXEC CMN010 XML Diagnose Error

/* Print out any error we do not expect, 6504 means 'no data found' */
/* and is not necessarily an error */

Diagnose_Error: 
  Select
.
. 
.
    when stem="SER1." then
      do 
        if SER1.reasonCode<> '6504' then 
          do 
            call Print_Line "Return Code:" rc "from SERXMLRC" (see Note 1)
            call Print_Line "Subsystem  :" SER1.Subsys 
            call Print_Line "Service    :", 
                 SER1.Service SER1.Message SER1.Scope 
            call Print_Line "Reason Code:" SER1.reasonCode    (see Note 2)  
            call Print_Status 
            call Disconnect rc 
          end 
        else 
          do 
            call Print_Line "No applications found" 
            call Disconnect 4 
          end 
        end
.
. 
.
      end 
    otherwise nop 
  end 
Return

Notes

  1. When RC is not 0, then SERXMLRC completed abnormally.
  2. When RC is not 0, there may be a reason code from the service.