× 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.



Scott,
We post the more complicated solutions because we know you'll come through with the simplest and best solution!

Gavin.


On 3/2/2021 2:47 PM, Scott Klement wrote:
Rob,

Literally... this is all you have to do to check if a subsystem is active:


    DCL VAR(&SBS)       TYPE(*CHAR) LEN(20)  VALUE('QSYS QINTER')
    DCL VAR(&RCVVAR)    TYPE(*CHAR) LEN(80)
    DCL VAR(&RCVVARLEN) TYPE(*INT)  LEN( 4) VALUE(80)
    DCL VAR(&STATUS)    TYPE(*CHAR) LEN(10)

    CALL PGM(QWDRSBSD) PARM(&RCVVAR &RCVVARLEN SBSI0100 &SBS +
                            X'0000000000000000')
    CHGVAR VAR(&STATUS) VALUE(%SST(&RCVVAR 29 10))

    /* AT THIS POINT, &STATUS WILL CONTAIN '*ACTIVE' IF THE +
       SUBSYSTEM IS ACTIVE. */


I can understand someone wanting something simpler... but is this whole idea of installing new user space commands, creating the space, running QShell and outputting to the space, etc business really simpler than just calling an API?

-SK


On 3/2/2021 1:16 PM, Rob Berendt wrote:
Well, if you really want to twist your head around something you can try this:
QSH CMD('db2 "SELECT COUNT(*) FROM qsys2.subsystem_info where status = ''ACTIVE'' and subsystem_description = ''QBATCH''" > /QSYS.LIB/ROB.LIB/ROBSQL.USRSPC')

Then install these commands to get RTVUSRSPC:
https://www.ibm.com/support/pages/creatingchangingretrieving-user-space-usrspc-ibm%C2%AE-iseries%E2%84%A2-family-servers

Too bad I couldn't get a pipe to a data area to work.

or this
QSH CMD('db2 "CREATE TABLE ROB.IFACTIVE AS(SELECT COUNT(*) AS JOBCOUNT FROM qsys2.subsystem_info where status = ''ACTIVE'' and subsystem_description = ''QBATCH'') WITH DATA"')
Then read that file with cl
Could not get the qtemp.ifactive to work.  I suspect that qsh is spawned as a different job with it's own qtemp.

CL is such a kludge.

Rob Berendt


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.