×
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.
Hi Michael,
Are there rules about when and where RTVJOBA ENDSTS can be queried in
the CL program for it to be valid?
Are there any system values that have to be set for this to work?
I'm not sure exactly what you're saying here... this support is
extremely simple (almost too simple to be useful, IMHO). At the instant
that you call the RTVJOBA command, it tells you whether a controlled end
has been issued against the job. (for example, via ENDJOB, ENDSBS or
PWRDWNSYS with OPTION(*CNTRLD) specified.)
It doesn't matter where in your program you run the RTVJOBA, as long as
you keep in mind that the value is only accurate at the instant you call
RTVJOBA. So you'll have to call RTVJOBA in a loop.
As a very simple test, try opening two 5250 emulator sessions. In one of
them try running the following program:
PGM
DCL VAR(&END) TYPE(*CHAR) LEN(1)
DOUNTIL (&END *EQ '1')
RTVJOBA ENDSTS(&END)
SNDPGMMSG MSGDTA(&END) MSGF(QCPFMSG) MSGTYPE(*STATUS)
MSGID(CPF9897) TOPGMQ(*EXT)
DLYJOB DLY(5)
ENDDO
SIGNOFF
ENDPGM
As this program runs, it'll display the &END value as a status message
at the bottom of your screen. At first, it'll be 0, which means that
the job isn't ending.
In the second 5250 session, use WRKACTJOB. Find the first session, and
put a 4 (for "end") next to it. Press F4 (rather than enter) and ensure
that you've given it a *CNTRLD end, and give it 30 seconds or so.
(These are the defaults.. I just want to make sure you're using them.)
Back in the first 5250 session, you'll see that the 0 will change to a 1
within 5 seconds or so. Then, after another 5 seconds, the program will
sign you off and you'll be back at the signon screen -- all because of
the #4 you selected in WRKACTJOB.
This support is identical to that provided by RPG's SHTDN op-code, or
%shtdn() BIF, if you're familiar with that.
No system values or configuration is necessary... this support works on
all systems out of the box.
As an Amazon Associate we earn from qualifying purchases.