Skip to content

Sample REXX EXEC CMN010 Mainline

/* Mainline ********************************************************* */ 
arg arguments 

/* validate users input parms */ 

 ok=CMN000(CMN010 arguments) 

 if ok= 'OK' then nop 
            else call Error_Message /* never to return */ 

/* Read input parms */ 
arg appname subname tsoname tst .

/* initialize variables and set defaults where appropriate */ 

call Init_Variables 

/* set up first xml service call */ 

call Init_XMLStem1 

/* make first xml service call */ 

call Serxmlrc

/* for each application returned perform 2nd XML call */ 

do jx=1 to SER1.result.0 
  call Init_XMLStem2              /* set up 2nd XML call */ 
  call Serxmlrc                   /* make 2nd XML call */ 
  if rxrc=0 then call Output_result /* if ok, print out result */ 
end 

/* Print out totals */ 

call Output_Totals 

/* terminate ZMF session */ 

call Disconnect

Note

This sample consists of three stages: The initialization of variables, the calls to SERXMLRC and the presentation of the results.