Values that can be returned for subsystem status:
*ACTIVE The subsystem is running.
*ENDING The subsystem are ending.
*INACTIVE The subsystem is not running.
*RESTRICT(ED) The controlling subsystem in a restricted condition.
*STARTING A STRSBS command has been issued for the subsystem *BLANKS Cannot allocate subsystem description.
CMD Source:
/*----------------------------------------------------------------MRB*/
/* Retrieve Subsystem Status (calling API QWDRSBSD) */
/*-------------------------------------------------------------------*/
/* CRTCMD CMD(RTVSBSSTS) PGM(*LIBL/RTVSBSSTSC) RCFILE(MYLIB/MYSRCFIL)*/
/* ALLOW(*IPGM *BPGM) HLPPNLGRP(*LIBL/RTVSBSSTSP) HLPID(RTVSBSSTS) */
/*-------------------------------------------------------------------*/
/* Marti Riera 13/11/2003 */
/* http://www.recursos-as400.com/ */
/* mailto:mrierab@terra.es */
/*-------------------------------------------------------------------*/
/* Values that can be returned for sbs status (&SBSSTS): */
/* *ACTIVE The subsystem is running. */
/* *ENDING An ENDSBS command has been issued for the subsystem */
/* or an ENDSYS command has been issued, but the */
/* subsystem is still running. */
/* *INACTIVE The subsystem is not running. */
/* *RESTRICT(ED) An ENDSBS command for the controlling subsystem, */
/* an ENDSYS *ALL command, or an ENDSYS command has */
/* has placed the controlling subsystem in a */
/* restricted condition. */
/* *STARTING A STRSBS command has been issued for the subsystem, */
/* but it is still in the process of being started. */
/* *BLANKS Cannot allocate subsystem description. */
/*-------------------------------------------------------------------*/
/* More information: */
/* http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2931/index.htm?-
info/apis/qwdrsbsd.htm */
/*-------------------------------------------------------------------*/
CMD PROMPT('Retrieve Subsystem Status')
PARM KWD(SBSNAM) TYPE(SBSNAM) SNGVAL((*)) MIN(1) +
PROMPT('Subsystem name')
SBSNAM: QUAL TYPE(*NAME) LEN(10) EXPR(*YES)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB)) EXPR(*YES) +
PROMPT('Library')
PARM KWD(SBSSTS) TYPE(*CHAR) LEN(9) RTNVAL(*YES) +
PROMPT('CL var Subsystem Status (9)') CLP Source:
/*----------------------------------------------------------------MRB*/
/* Retrieve Subsystem Status (calling API QWDRSBSD) */
/* Marti Riera 13/11/2003 */
/* http://www.recursos-as400.com/ */
/* mailto:mrierab@terra.es */
/*-------------------------------------------------------------------*/
/* Values that can be returned for sbs status (&SBSSTS): */
/* *ACTIVE The subsystem is running. */
/* *ENDING An ENDSBS command has been issued for the subsystem */
/* or an ENDSYS command has been issued, but the */
/* subsystem is still running. */
/* *INACTIVE The subsystem is not running. */
/* *RESTRICT(ED) An ENDSBS command for the controlling subsystem, */
/* an ENDSYS *ALL command, or an ENDSYS command has */
/* has placed the controlling subsystem in a */
/* restricted condition. */
/* *STARTING A STRSBS command has been issued for the subsystem, */
/* but it is still in the process of being started. */
/* *BLANKS Cannot allocate subsystem description. */
/*-------------------------------------------------------------------*/
/* More information: */
/* http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2931/index.htm?-
info/apis/qwdrsbsd.htm */
/*-------------------------------------------------------------------*/
PGM PARM(&SBSNAM &SBSSTS)
DCL VAR(&SBSNAM) TYPE(*CHAR) LEN(20)
DCL VAR(&SBSSTS) TYPE(*CHAR) LEN(9)
DCL VAR(&SBSSTSC) TYPE(*CHAR) LEN(12)
DCL VAR(&RCV) TYPE(*CHAR) LEN(244)
DCL VAR(&RCVL) TYPE(*DEC) LEN(4)
DCL VAR(&SBSFMT) TYPE(*CHAR) LEN(8)
DCL VAR(&ERR) TYPE(*DEC) LEN(4)
/* Set receiver variable to length = 136 */
CHGVAR VAR(&RCVL) VALUE(244)
/* Use qualified sbs name format */
CHGVAR VAR(&SBSFMT) VALUE(SBSI0200)
/* Retrieve subsystem status */
CALL PGM(QWDRSBSD) PARM(&RCV &RCVL &SBSFMT &SBSNAM
&ERR)
/* Extract sbs status from receiver */
CHGVAR VAR(&SBSSTSC) VALUE(%SST(&RCV 53 12))
CHGVAR VAR(&SBSSTS) VALUE(&SBSSTSC)
/* Send status */
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('Subsystem status' *BCAT &SBSNAM +
*TCAT ' is' *BCAT &SBSSTSC *TCAT '.') +
MSGTYPE(*STATUS)
/* End program */
RETURN
ENDPGM
PNLGRP Source:
.*-----------------------------------------------------------------MRB*
.* Retrieve Subsystem Status (calling API QWDRSBSD) *
.* PANEL NAME : RTVSBSSTSP - Help Text *
.*--------------------------------------------------------------------*
.* CRTPNLGRP PNLGRP(*LIB/RTVSBSSTSP) SRCFILE(&MYSRCLIB/&MYSRCFILE) *
.*--------------------------------------------------------------------*
.* Marti Riera 03/06/2005 *
.* http://www.recursos-as400.com/ *
.* mailto:mrierab@terra.es *
.*--------------------------------------------------------------------*
.* 06/03/2006: Modificacion para recuperar mas estados de subsistema *
.* con el formato SBSI0200 *
.*--------------------------------------------------------------------*
:PNLGRP.
.*--------------------------------------------------------------------*
.* Primary help text for the command. *
.*--------------------------------------------------------------------*
:HELP NAME='RTVSBSSTS'.
Retrieve subsystem status
:P.
RTVSBSSTS Retrieve the subsystem status
:EHELP.
.*--------------------------------------------------------------------*
.* Help text for the command parameters. *
.*--------------------------------------------------------------------*
:HELP NAME='RTVSBSSTS/SBSNAM'.
:XH3.Subsystem name (SBSNAM)
:P.
Input the subsystem and library name.
:EHELP.
.**********************************************************************
:HELP NAME='RTVSBSSTS/SBSSTS'.
:XH3.Subsystem Status (SBSSTS)
:P.
Specified the name of the CL variable that receives the value subsystem status.
The variable must be a character variable with minimum length of 9 characters.
:P.
Note: For compatibility with previous version of command, the length of
9
characters is used, for that reason value *RESTRICTED is given back *RESTRICT.
:P.
Values that can be returned for subsystem status:
:P.
:HP2.*ACTIVE:EHP2. The subsystem is running.
:P.
:HP2.*ENDING:EHP2. An ENDSBS command has been issued for the subsystem or an ENDSYS command has been issued, but the subsystem is still running.
:P.
:HP2.*INACTIVE:EHP2. The subsystem is not running.
:P.
:HP2.*RESTRICT(ED):EHP2. An ENDSBS command for the controlling subsystem, an ENDSYS *ALL command, or an ENDSYS command has placed the controlling subsystem in a restricted condition.
:P.
:HP2.*STARTING:EHP2. A STRSBS command has been issued for the subsystem, but it is still in the process of being started.
:P.
:HP2.*BLANKS:EHP2. Cannot allocate subsystem description.
:EHELP.
.*--------------------------------------------------------------------*
:EPNLGRP.
This was first published in April 2006