Skip to content

Sample REXX EXEC CMN010 XML Disconnect Code

/* Disconnect and set return code */ 
Disconnect: 
  arg exitcode 
  if exitcode =' ' then exitcode ='0' 
  call Init_XMLstem0 
  call Serxmlrc 
  drop SER0. 
  exit exitcode

/* Set variables for XML call */

Init_XMLStem0: 
     rxrc         = 0          /* initialize our return code */
     stem         = "SER0."    /* set outgoing stem name */ 
     SER0.        = ""         /* initialize outgoing stem */
     SER0.Subsys  = subname    /* subsystem name to query */
     SER0.Userid  = tsoname    /* userid */
     SER0.Test    = tst        /* set test value */
     SER0.Product = "CMN "     /* set product */
     SER0.Service = "        " /* set service */
     SER0.Message = "DISCONCT" /* set message */
     SER0.Scope   = "SERVICE"  /* set scope */
Return

All messages good and bad are recorded in the REXX variable STEM.Message.n. The number of messages is in STEM.Message.0. The most common error is when the subsystem is not up. In this case, the above example fails:

Following is the output for an unsuccessful execution of CMN010:

Report CMN010 generated from subsystem: 8 on: 24 Mar 2009 at: 09:42:35 Page: 1
-----------------------------------------
Summary of Planned and Unplanned Packages
-----------------------------------------
Application Simple   Complex  Super    Participating Planned   Planned   Unplanned Unplanned
Name        Packages Packages Packages Packages      Permanent Temporary Permanent Temporary
----------- -------- -------- -------- ------------- --------- --------- --------- ---------
Return Code: 8 from SERXMLRC 
Subsystem  :
Service    :
Reason Code: 6028
Message    : SER6602I Using defined TEST option T
Message    : SER6604I Using specified IncludeInResult: applName
Message    : SerNet started task "8" is not active (Error=5)
Message    : SerNet started task "8" is not active (Error=5)
Message    : Connection failed
Message    : SerNet started task "8" is not active (Error=5)
Message    : Connection failed
******************************** BOTTOM OF DATA ********************************************

Following is the output for a successful execution of CMN010:

Report CMN010 generated from subsystem: 8 on: 24 Mar 2009 at: 05:58:55 Page: 1
-----------------------------------------
Summary of Planned and Unplanned Packages
-----------------------------------------
Application Simple   Complex  Super    Participating Planned   Planned   Unplanned Unplanned
Name        Packages Packages Packages Packages      Permanent Temporary Permanent Temporary
----------- -------- -------- -------- ------------- --------- --------- --------- ---------
ACTP              14        0        0             0        14         0         0         0
----------- -------- -------- -------- ------------- --------- --------- --------- ---------
Totals            14        0        0             0        14         0         0         0
----------- -------- -------- -------- ------------- --------- --------- --------- ---------
******************************** BOTTOM OF DATA *********************************************