Tip

Use the RTVSBSSTS command to retrieve the subsystem status

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.