Hi Rob

I have a script that writes to a data area:

declare warncount
warncount=$(grep -c '="WARNTEXT'
/integral/syschecks/SysCheck-Current.html) if [ warncount -ne 0 ]
then

warncount=$(grep '="WARNTEXT'
/integral/syschecks/SysCheck-Current.html|cut -d '>' -f2|cut -d ' '
-f1) fi
echo
$warncount
datarea -w /qsys.lib/ejhlib.lib/warncount.dtaara $warncount

Last line is the one that you might be interested in - the datarea command -

I have the rest there just for a bit of context (the script pulls a
number out of a html file)

Maybe that will help you.




On Wed, Mar 3, 2021 at 8:16 AM Rob Berendt <rob@xxxxxxxxx> 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
--
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 Rob
Berendt
Sent: Tuesday, March 2, 2021 12:04 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
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
--
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




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.