View Full Version : Determining if a subsystem is ending *CNTRLD
Guest.Visitor
01-01-1995, 02:00 AM
I found an "ugly" way to do it, but there appear to be no APIs to determine if a subsystem is ending *CNTRLD. I may have a long-running job in a subsystem and the subsystem may have been set to end *CNTRLD and I needed to find out if that was the case. After some research, I tried the QUSRJOBI (Retrieve Job Information) API, format JOBI0600. It looked (from the documentation) like the "End status" byte should show it, but experimentation revealed that it did not! Most of the other "status"-type fields in job/subsystem APIs have values like *ACTIVE/*JOBQ/*OUTQ. The only way I've found that works is to try ending the subsystem *CNTRLD again. If it already is, I get CPF1055 - "Subsystem xxxxxxxxxx ending with *CNTRLD option". If it has ended, I get CPF1054 - "No subsystem xxxxxxxxxx active". Unfortunately, if it ISN'T already ending *CNTRLD, this causes it to end.... Other methods might be to look in the system history log or QSYSOPR for CPF0995 - "Subsystem xxxxxxxxxx ending in progress", issued by job QSYSARBn. But that also appears for ENDSBS *IMMED. And there's nothing to tell me what the ending options are, either -- is it DELAY(3600) or *NOLIMIT? What about ENDSBSOPT()? If the info isn't available, maybe I should bug IBM for an API....
Guest.Visitor
10-18-2000, 10:18 PM
Hi Ken, There are a number of ways to tell if the subsystem (or system or job) is ending *CNTRLD. 1) RPG SHTDN op code will return, sob, indicator set on if so. 2) RTVJOBA ENDSTS parameter has value '1' if so 3) QUSRJOBI API format JOBI600 field End status has value '1' if so I repeat all three of these methods don't discriminate between the above three conditions. My guess is that you would want the same processing to be carried out anyway. HTH, Kevin Wright.
Guest.Visitor
10-19-2000, 11:35 AM
The problem is, if I run QUSRJOBI on the *subsystem itself*, it does NOT show an End Status of '1'. There's no way, by looking at the *subsystem* job, to see if it's ending *CNTRLD. I don't know what to call it other than the "subsystem job", as distinct from a job running in the subsystem. However, your suggestions made me think of testing a job running IN the subsystem, and indeed QUSRJOBI does have an End Status of '1' for THAT job. So this's what I'll have to do: see if there are any jobs running in the subsystem, then use QUSRJOBI format JOBI0600 on one of those jobs. This is being done by a job running elsewhere, not by a job running IN the subsystem I'm interested in, so checking SHTDWN or RTVJOBA ENDSTS doesn't apply. Thanks, Ken
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.