× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I wrote a program that Audit's Active Subsystems.  With some Tweaking, you could make this look at a single Subsystem.

Table Creation:

CREATE TABLE QTEMP.SBSDESCQ  (SYSTEM CHAR(8) NOT NULL,
 SBSNAM CHAR(10) NOT NULL,
 SBSLIB CHAR(10) NOT NULL,
 SBSJOBQ CHAR(10) NOT NULL,
 SBSJOBQL CHAR(10) NOT NULL,
 SBSJOBQS DEC(4,0),
 SBSTEXT CHAR(50) NOT NULL,
 SBSTEXT2 CHAR(50) NOT NULL )
  RCDFMT RSBSDESC;

 LABEL ON TABLE QTEMP.SBSDESCQ IS 'Subsystem Job Queues';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SYSTEM TEXT IS 'System Name';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSNAM TEXT IS 'Subsystem Name';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSLIB TEXT IS 'Subsystem Library';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSJOBQ TEXT IS 'Job Queue Name';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSJOBQL TEXT IS 'Job Queue Library';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSJOBQS TEXT IS 'Job Queue Sequence';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSTEXT TEXT IS 'Subsystem Description';
 LABEL ON COLUMN QTEMP.SBSDESCQ.SBSTEXT2 TEXT IS 'Job Queue Description';


RPG Program to Audit All Active Subsystems

      * Audit Active Subsystem Descriptions
     H COPYRIGHT('Written By Gavin Inman')
     H dftactgrp(*no) Actgrp('AUDIT')

     FSBSDESCQ  UF A E             DISK    USROPN

     d Main            pr                  ExtPGM('AUDSBSD')
     D                                8A
     dMain             PI
     D  sysnam1                       8A
     dSpcName          ds
     d spcname1                      10    inz('@@JOBQSPC')
     d spclib1                       10    inz('QTEMP')

     DGetObjd          PR                  extpgm( 'QUSROBJD' )
     D Reciever                            likeds(QUSD0200)
     D RcvLen                        10i 0 Const
     D dlsfmt                         8a   const
     D ObjNam                              likeds(Object)
     D ObjType                       10a   const
     D QUSEC                               likeds(QUSEC) options(*nopass)

     D qcmdexc         PR                  extpgm('QCMDEXC')
     D   stdcmd                            like(cmd) options(*varsize) const
     D   stdlen                            like(len) const

     DGetActsbs        PR                  extpgm('QWDRSBSD' )
     D Reciever                            likeds(Result)
     D RcvLen                        10i 0 Const
     D dlsfmt                         8a   const
     D sbsname                       20a   const
     D QUSEC                               likeds(QUSEC) options(*nopass)

     DGetsubinfo       pr                  extpgm( 'QWDLSJBQ' )
     D UsrSpcName                          likeds(SpcName)
     D dlsfmt                         8a   const
     D Subsystem                           likeds(Object)
     D QUSEC                         10a   const

     dCrtUsrSpc        pr                  extpgm('QSYS/QUSCRTUS')
     d UsrSpcName                          likeds(SpcName)
     d SpcAttr                       10    const
     d SpcSiz                        10i 0 const
     d SpcVal                         1    const
     d SpcAut                        10    const
     d SpcTxt                        50    const
     d SpcRpl                        10    const options(*nopass)
     d QUSEC                               likeds(QUSEC) options(*nopass)
     d SpcDmn                        10    const options(*nopass)
     d SpcTfrSiz                     10i 0 const options(*nopass)
     d SpcOptAln                      1    const options(*nopass)

     dRtvSpcPtr        pr                  extpgm('QSYS/QUSPTRUS')
     d UsrSpcName                    20
     d UsrSpcPtr                       *
     d QUSEC                               likeds(QUSEC) options(*nopass)

     d Result          ds                  Qualified
     D ASBytes                       10i 0
     D ASAvail                       10i 0
     D ASoffset                      10i 0
     D ASEntries                     10i 0
     D ASEntrysz                     10i 0
     D ASReserve                     12a
     D data                         128a   dim(50)

     dObject           ds                  Qualified
     d name                          10
     d Lib                           10

     dSubdata          ds                  Qualified
     d Name                          10
     d Lib                           10
     d Status                        12
     d Maxjobs                       10i 0
     d ActJobs                       10i 0
     d Monitor                       10
     d Monuser                       10
     d MonNbr                         6
     d Text                          50
     d Reserved                       1
     d Data                    1    128

      /copy qsysinc/qrpglesrc,qusgen
      /copy qsysinc/qrpglesrc,qwdlsjbq
      /copy qsysinc/qrpglesrc,qusec
      /copy qsysinc/qrpglesrc,qusrobjd

     DGenHdr           ds                  likeds(QUSH0100)
     D                                     based(GenHdrPtr)
     dHdrEntry         ds                  likeds(QWDLH)
     d                                     based(HdrPtr)
     dLstEntry         ds                  likeds(QWDL0100)
     d                                     based(LstPtr)

     DFormat           S              8a   inz('SBSI0200')
     DOType            S             10a   inz('*JOBQ    ')
     DUsrSpcPtr        S               *
     dLstCount         s             10i 0
     dNbr              s             10i 0
     dRcvVarLen        s             10i 0
     dRcvVar           s          12000a   varying
     D cmd             S           4096
     D msgcmd          S           4096
     D len             S             15P 5

     C/free
        // Create Data File
        len = %size(cmd) ;
        cmd = 'DLTF QTEMP/SBSDESCQ' ;
        exsr $cmd ;
        cmd = 'RUNSQLSTM SRCFILE(*LIBL/QSQLSRC) ' +
          'SRCMBR(SBSDESCQ) COMMIT(*NONE) NAMING(*SQL)' ;
        exsr $cmd ;
        Open SBSDESCQ ;

         // Get Active Subsystems
        Object.name = '*ACTIVE' ;
        RcvVarLen = %size(RESULT) ;
        GetActsbs(Result: RcvVarLen: Format :Object: QUSEC );

        for Nbr = 1 to  result.ASEntries ;

          SubData.data =  result.data(Nbr) ;

        // Create a *USRSPC
          CrtUsrSpc(SpcName  :' ' :1 :x'00' :'*ALL'
                :' ' :'*YES' :QUSEC );

         // Get Information into *USRSPC

           Format = 'SJQL0100' ;
           Object.name = subdata.Name ;
           Object.lib = subdata.Lib ;
           sbstext = subdata.text ;
           sbsnam = subdata.Name;
           sbslib = subdata.Lib;

           GetSubInfo(SpcName : Format : Object : QUSEC );

         // Read *USRSPC
           RtvSpcPtr(SpcName :UsrSpcPtr :QUSEC);

           GenHdrPtr = UsrSpcPtr ;

         //  Did the retrieve work?
         if (GenHdr.QUSIS = 'C') ;

         // Get Header Entry
          HdrPtr = GenHdrPtr + GenHdr.QUSOHS;
         // Name = HdrEntry.QWDSN00;
         // Library = HdrEntry.QWDSLN00 ;

         // Process List to find Subsystem

          LstPtr = GenHdrPtr + GenHdr.QUSOLD;

          for LstCount = 1 to GenHdr.QUSNBRLE;

          Lstptr = (GenHdrPtr + GenHdr.QUSOLD) +
                   (GenHdr.QUSSEE * (LstCount -1)) ;

           //  Values are in the LSTENTRY Data Structure.
           //  Format from QSYSINC/QRPGLESRC QWDLSJBQ  (format QWDL0100)
            sbsjobq  = LstEntry.QWDJQN ;
            Object.name = LstEntry.QWDJQN ;
            sbsjobql = LstEntry.QWDJQLN  ;
            Object.lib = LstEntry.QWDJQLN  ;
            sbsjobqs = LstEntry.QWDSNBR ;
            Format = 'OBJD0200' ;
            RcvVarLen = 180;
            GetObjd(QUSD0200: RcvVarLen: Format :Object:Otype:QUSEC );
            sbstext2 = QUSTD12 ;

            write rsbsdesc ;

           endfor;
          endif;
        ENDFOR;

        eval *INLR = *ON ;
        RETURN;
        READ  Rsbsdesc ;
        // Execute a command and log it
        begsr $CMD ;
         monitor;
         qcmdexc (cmd:len);
         on-error;
         endmon;
        endsr ;
      /END-FREE


Gavin Inman


On 3/2/2021 1:01 PM, Mayer, Michael via MIDRANGE-L wrote:

This works at V7R2 .... it isn't the latest but it works. Yes, I know but it's not my decision, I can only strongly make the case to upgrade so many times.

Examples:
SELECT * FROM TABLE(QSYS2.ACTIVE_JOB_INFO(SUBSYSTEM_LIST_FILTER => 'MONITOR')) A Or SELECT * FROM TABLE(QSYS2.ACTIVE_JOB_INFO(SUBSYSTEM_LIST_FILTER => 'QHTTPSVR')) A

Obviously just change 'MONITOR' or QHTTPSVR to what is needed.

To Mark W's point in message 4, WRKSBS *print should give you a simple print out of the subsystems that are active. WRKSBS * writes the active SBS's to the display.


Very Respectfully,
Michael Mayer
IBM I on Power System Admin.
IT Operations.
The Florida Bar
651 E. Jefferson St
Tallahassee, Florida 32399-2300
mmayer@xxxxxxxxxxxxxx
https://www.floridabar.org
Office: 850.561.5761
Cell: 518.641.8906


Today's Topics:

1. Is there a simple way for a CL program to determine whether a
given subsystem is active? (James H. H. Lampert)
2. RE: Is there a simple way for a CL program to determine
whether a given subsystem is active? (Rob Berendt)
3. Re: Is there a simple way for a CL program to determine
whether a given subsystem is active? (Mark Waterbury)
4. Re: Is there a simple way for a CL program to determine
whether a given subsystem is active? (Mark Waterbury)


----------------------------------------------------------------------

message: 1
date: Tue, 2 Mar 2021 08:55:54 -0800
from: "James H. H. Lampert" <jamesl@xxxxxxxxxxxxxxxxx>
subject: Is there a simple way for a CL program to determine whether a
given subsystem is active?

I'll admit that I haven't done more than a cursory look at the CMDJOB and CMDSBS menus (and even that only on our V4R4 box, even though the box I'm asking this for is on V7), but short of an API call, can a CL program easily check to see if a given subsystem is active?

--
JHHL


------------------------------

message: 2
date: Tue, 2 Mar 2021 17:04:10 +0000
from: Rob Berendt <rob@xxxxxxxxx>
subject: RE: Is there a simple way for a CL program to determine
whether a given subsystem is active?

How tied are you to CL?

select subsystem_description_library, subsystem_description, maximum_active_jobs,
current_active_jobs, subsystem_monitor_job, text_description,
controlling_subsystem, workload_group, signon_device_file_library,
signon_device_file, secondary_language_library, iasp_name
from qsys2.subsystem_info
where status = 'ACTIVE'
order by current_active_jobs desc;

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 7310 Innovation Blvd, Suite 104
Ft. Wayne, IN 46818
Ship to: 7310 Innovation Blvd, Dock 9C
Ft. Wayne, IN 46818
http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of James H. H. Lampert
Sent: Tuesday, March 2, 2021 11:56 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Is there a simple way for a CL program to determine whether a given subsystem is active?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


I'll admit that I haven't done more than a cursory look at the CMDJOB and CMDSBS menus (and even that only on our V4R4 box, even though the box I'm asking this for is on V7), but short of an API call, can a CL program easily check to see if a given subsystem is active?

--
JHHL
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


------------------------------

message: 3
date: Tue, 2 Mar 2021 17:09:16 +0000 (UTC)
from: Mark Waterbury <mark.s.waterbury@xxxxxxxxxxxxx>
subject: Re: Is there a simple way for a CL program to determine
whether a given subsystem is active?

Rob,
I believe that can even be done from CL by creating an SQL VIEW with that statement in it, and then a DCLF to point to the view, and RCVF to read thru the resulting rows.? :-) Cheers, Mark S. Waterbury

On Tuesday, March 2, 2021, 12:04:23 PM EST, Rob Berendt <rob@xxxxxxxxx> wrote:

How tied are you to CL?

select subsystem_description_library, subsystem_description, maximum_active_jobs, ? ? ? current_active_jobs, subsystem_monitor_job, text_description, ? ? ? controlling_subsystem, workload_group, signon_device_file_library, ? ? ? signon_device_file, secondary_language_library, iasp_name ? from qsys2.subsystem_info ? where status = 'ACTIVE'
? order by current_active_jobs desc;

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to:? 7310 Innovation Blvd, Suite 104 ? ? ? ? ? Ft. Wayne, IN 46818 Ship to:? 7310 Innovation Blvd, Dock 9C ? ? ? ? ? Ft. Wayne, IN 46818 http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of James H. H. Lampert
Sent: Tuesday, March 2, 2021 11:56 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Is there a simple way for a CL program to determine whether a given subsystem is active?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


I'll admit that I haven't done more than a cursory look at the CMDJOB and CMDSBS menus (and even that only on our V4R4 box, even though the box I'm asking this for is on V7), but short of an API call, can a CL program easily check to see if a given subsystem is active?

--
JHHL
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


------------------------------

message: 4
date: Tue, 2 Mar 2021 17:19:06 +0000 (UTC)
from: Mark Waterbury <mark.s.waterbury@xxxxxxxxxxxxx>
subject: Re: Is there a simple way for a CL program to determine
whether a given subsystem is active?

James,
On older versions of OS/400, you could issue:

??? WRKSBS OUTPUT(*PRINT)
and then copy the spool file to a physical file, and DCLF / RCVF to read thru and parse the results.
HTH,
Mark S. Waterbury

On Tuesday, March 2, 2021, 11:56:12 AM EST, James H. H. Lampert <jamesl@xxxxxxxxxxxxxxxxx> wrote:

I'll admit that I haven't done more than a cursory look at the CMDJOB and CMDSBS menus (and even that only on our V4R4 box, even though the box I'm asking this for is on V7), but short of an API call, can a CL program easily check to see if a given subsystem is active?

--
JHHL
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


------------------------------

Subject: Digest Footer

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) digest list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


------------------------------

End of MIDRANGE-L Digest, Vol 20, Issue 297
*******************************************

________________________________
Please note: Florida has very broad public records laws. Many written communications to or from The Florida Bar regarding Bar business may be considered public records, which must be made available to anyone upon request. Your e-mail communications may therefore be subject to public disclosure.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.