The Retrieve Job Attributes 2 command is similar to the system
RTVJOBA command, but allows retrieval of the attributes for any job
and supports more parameters. The system command is limited to the
current job. Because the number of parameters exceeds the maximum
that may be passed to a CL program (used for the command processing
program), three commands are supported (RTVJOBA2, RTVJOBA2A, and
RTVJOBA2B).
A typical command would be:
DCL &ACTJOBSTS *CHAR LEN(10)
.
RTVJOBA2 JOB(xxx) ACTJOBSTS(&ACTJOBSTS)
Either a fully qualified command name or the special value * (current
job) must be entered. One or more return variables can be specified
on the same command. If RTVJOBA2 does not have the information you
are looking for, check RTVJOBA2A and RTVJOBA2B.
You must be in the current job or be the user of the job or have
*JOBCTL special authority to access the information from another job.
RTVJOBA2 escape messages you can monitor for
--------------------------------------------
TAA9892 A fully qualified job name must be entered.
TAA9893 The job does not exist
Escape messages from based on functions will be re-sent.
RTVJOBA2 Command parameters *CMD
---------------------------
JOB The job name of the job to be retrieved. * is the
default for the current job. A fully qualified job
name must be used if the job is not the current job.
USER The user of the job. This information may be of
value if JOB(*) was specified. If used, the return
variable must be specified as *CHAR LEN(10).
NBR The job number of the job. This information may be
of value if JOB(*) was specified. If used, the
return variable must be specified as *CHAR LEN(6).
CURUSER The current user of the job. If used, the return
variable must be specified as *CHAR LEN(10).
JOBSTS The status of the job. The value will be *ACTIVE,
*JOBQ, or *OUTQ. If used, the return variable must
be specified as *CHAR LEN(10).
JOBTYP The job type. A value will exist such as INT
(Interactive). These are the same types as
displayed by WRKACTJOB. If used, the return
variable must be specified as *CHAR LEN(10).
RUNPTY The run priority of the job. The run priority
(01-99) with 01 the best priority. If used, the
return variable must be specified as *DEC LEN(2 0).
POOLID The pool ID of the job. If used, the return
variable must be specified as *DEC LEN(5 0).
CPUTIM The CPU time used in milliseconds. If used, the
return variable must be specified as *DEC LEN(11 0).
AUXIO The amount of auxiliary I/O used. If used, the
return variable must be specified as *DEC LEN(11 0).
INTTRANS The number of interactive transactions entered. If
used, the return variable must be specified as *DEC
LEN(11 0).
RSPTOTAL The total amount of response time used by an
interactive job in milliseconds. If used, the
return variable must be specified as *DEC LEN(11 0).
FUNCTION The function of the initial thread of the job. A
value like PGM will be returned. This is the same
value as seen on WRKACTJOB. If used, the return
variable must be specified as *CHAR LEN(3).
FUNCTNAM The name of the function of the initial thread of
the job. The value will be associated with the
Function Name such as the program name. This is the
same value as seen on WRKACTJOB. If used, the
return variable must be specified as *CHAR LEN(10).
ACTJOBSTS The active job status. A value such as RUN will be
returned. This is the same value as seen on
WRKACTJOB in the 'Status' column. If used, the
return variable must be specified as *CHAR LEN(10).
OUTQ The output queue assigned to the job. If used, the
return variable must be specified as *CHAR LEN(10).
OUTQLIB The output queue library assigned to the job. If
used, the return variable must be specified as *CHAR
LEN(10).
OUTPTY The output priority assigned by default to spooled
files. A value 1-9 will be returned. If used, the
return variable must be specified as *CHAR LEN(1).
PRTDEV The printer device assigned to the job (if any). If
used, the return variable must be specified as *CHAR
LEN(10).
JOBQ The job queue the job started on (if any). If used,
the return variable must be specified as *CHAR
LEN(10).
JOBQLIB The job queue library the job started on (if any).
If used, the return variable must be specified as
*CHAR LEN(10).
JOBQPTY The job queue priority the job started with (if
any). A value 1-9 will be returned. If used, the
return variable must be specified as *CHAR LEN(1).
JOBQSTS The status of the job on the job queue (if any).
The value SCD, HLD, RLS, or blank will be returned.
If used, the return variable must be specified as
*CHAR LEN(10).
JOBQDATE The date the job was placed on the job queue (if
any). The date if it exists will be in CYYMMDD
format. If used, the return variable must be
specified as *CHAR LEN(7).
JOBQTIME The time the job was placed on the job queue (if
any). The time if it exists will be in HHMMSS
format. If used, the return variable must be
specified as *CHAR LEN(6).
SBMJOB The name of the job that submitted the job being
retrieved if any. If used, the return variable must
be specified as *CHAR LEN(10).
SBMUSER The user of the job that submitted the job being
retrieved if any. If used, the return variable must
be specified as *CHAR LEN(10).
SBMJOBNBR The job number of the job that submitted the job
being retrieved if any. If used, the return
variable must be specified as *CHAR LEN(10).
SBMMSGQ The message queue of the job that submitted the job
being retrieved if any. If used, the return
variable must be specified as *CHAR LEN(10).
SBMMSGQLIB The message queue library of the job that submitted
the job being retrieved if any. If used, the return
variable must be specified as *CHAR LEN(10).
ENTDATE The date of the job when entered into the system.
The date will be returned in the format CYYMMDD. If
used, the return variable must be specified as *CHAR
LEN(7).
ENTTIME The time of the job when entered into the system.
The time will be returned in the format HHMMSS. If
used, the return variable must be specified as *CHAR
LEN(6).
ACTDATE The date of the job when it became active. The date
will be returned in the format CYYMMDD. If used,
the return variable must be specified as *CHAR
LEN(7).
ACTTIME The time of the job when it became active. The time
will be returned in the format HHMMSS. If used, the
return variable must be specified as *CHAR LEN(6).
ACGCDE The job accounting code assigned to the job (if
any). If used, the return variable must be
specified as *CHAR LEN(15).
JOBD The job description used initially by the job. If
used, the return variable must be specified as *CHAR
LEN(10).
JOBDLIB The job description library used initially by the
job. If used, the return variable must be specified
as *CHAR LEN(10).
RTVJOBA2A Command parameters *CMD
----------------------------
JOB The job name of the job to be retrieved. * is the
default for the current job. A fully qualified job
name must be used if the job is not the current job.
UNITWORKID The unit of work ID of the job. If used, the return
variable must be specified as *CHAR LEN(24).
INQMSGRPY The value of the Inquiry Message Reply attribute
assigned to the job. The value returned will be
*RQD, *DFT, or *SYSRPLY. If used, the return
variable must be specified as *CHAR LEN(10).
BRKMSG The value of the Break Message attribute assigned to
the job. The value returned will be *NORMAL,
*NOTIFY, or *HOLD. If used, the return variable
must be specified as *CHAR LEN(10).
STSMSG The value of the Status Message attribute assigned
to the job. The value returned will be *NONE, or
*NORMAL. If used, the return variable must be
specified as *CHAR LEN(10).
DEVRCYACN The value of the Device Recovery action assigned to
the job. The value returned will be *MSG, *DSCMSG,
*DSCENDRQS, *ENDJOB, or *ENDJOBNOLIST. If used, the
return variable must be specified as *CHAR LEN(10).
DDMCNV The value of the DDM Conversation attribute taken
for the job. The value returned will be *KEEP or
*DROP. If used, the return variable must be
specified as *CHAR LEN(10).
DECFMT The value of the Decimal Format assigned to the job.
The same values exist as on the system RTVJOBA
command (blank = use a period, J=use a comma,
I=comma). If used, the return variable must be
specified as *CHAR LEN(1).
DATSEP The value of the Date Separator assigned to the job.
If used, the return variable must be specified as
*CHAR LEN(1).
DATFMT The value of the Date Format assigned to the job.
If used, the return variable must be specified as
*CHAR LEN(4) and will contain a value such as *MDY.
PRTTXT The value of the Print Text assigned to the job. If
used, the return variable must be specified as *CHAR
LEN(30).
TIMSEP The value of the Time Separator assigned to the job.
If used, the return variable must be specified as
*CHAR LEN(1).
CCSID The value of the Coded Character Set identifier
assigned to the job. If used, the return variable
must be specified as *DEC LEN(5 0).
SCDDATE The date the job is to be scheduled (if any). If a
value exists, it is in the format CYYMMDD. If used,
the return variable must be specified as *CHAR
LEN(7).
SCDTIME The time the job is to be scheduled (if any). If a
value exists, it is in the format HHMMSS. If used,
the return variable must be specified as *CHAR
LEN(6).
PRTKEYFMT The value of the Print Key format assigned to the
job. The value returned will be *NONE, *PRTDBR,
*PRTHDR, or *PRTALL. If used, the return variable
must be specified as *CHAR LEN(10).
SRTSEQ The value of the Sort Sequence assigned to the job.
If used, the return variable must be specified as
*CHAR LEN(10).
SRTSEQLIB The value of the Sort Sequence library assigned to
the job. If used, the return variable must be
specified as *CHAR LEN(10).
LANGID The value of the Language ID assigned to the job.
If used, the return variable must be specified as
*CHAR LEN(3).
CNTRYID The value of the Country ID assigned to the job. If
used, the return variable must be specified as *CHAR
LEN(2).
ENDSEV The value of the End Severity assigned to the job.
If used, the return variable must be specified as
*DEC LEN(2 0).
LOGLVL The value of the Log Level assigned to the job. The
value returned will be 0-4. If used, the return
variable must be specified as *CHAR LEN(1).
LOGSEV The value of the Log Severity assigned to the job.
The value returned will be 0-99. If used, the
return variable must be specified as *DEC LEN(2 0).
LOGTYPE The value of the Log Type assigned to the job. The
value returned will be *MSG, *SECLVL, or *NOLIST.
If used, the return variable must be specified as
*CHAR LEN(10).
CURUSER The current user of the job. This is the current
user profile of the job and may differ than the user
who started the job. If used, the return variable
must be specified as *CHAR LEN(10).
DEV The device assigned to an interactive job. If used,
the return variable must be specified as *CHAR
LEN(10).
SPCENV The Special Environment of the job. If used, the
return variable must be specified as *CHAR LEN(10).
PRDRTNCDE The Product Return code set by the compiler for ILE
languages. If used, the return variable must be
specified as *DEC LEN(9 0).
USRRTNCDE The User Return code set by the ILE languages. The
system API documentation now says 'do not use this
field' so it has been removed from the CL program.
Zeros will be returned. If specified, the return
variable must be declared as *DEC LEN(9 0).
PGMRTNCDE The Program Return code set by certain OPM
Languages. If used, the return variable must be
specified as *DEC LEN(9 0).
SYSLIBL The list of libraries on the System Portion of the
Library list. Each entry is 11 bytes (library name
followed by a blank). The information is only
available if the job is active. If used, the return
variable must be specified as *CHAR LEN(165).
PRDLIB The list of product libraries if any. Each entry is
11 bytes (library name followed by a blank). The
information is only available if the job is active.
If used, the return variable must be specified as
*CHAR LEN(55). This allows for potential growth.
At this point only 2 product libraries can exist
(length of 22).
CURLIB The current library if it exists. The information
is only available if the job is active. If used,
the return variable must be specified as *CHAR
LEN(10).
USRLIBL The list of libraries on the User Portion of the
Library list. Each entry is 11 bytes (library name
followed by a blank). If used, the return variable
must be specified as *CHAR LEN(2750).
SBS The subsystem the job exists in if the job is
active. If used, the return variable must be
specified as *CHAR LEN(10).
SBSLIB The subsystem library the job exists in if the job
is active. If used, the return variable must be
specified as *CHAR LEN(10).
TMPSTG The amount of temporary storage in MB. If used, the
return variable must be specified as *DEC LEN(11 0).
MAXTMPSTG The maximum amount of temporary storage in MB. If
*NOMAX was specified, a -1 will be returned. If
used, the return variable must be specified as *DEC
LEN(11 0).
THDCNT The number of threads. If used, the return variable
must be specified as *DEC LEN(11 0).
ENDSTS The ending status of the job. A blank means the job
is not running. 0=The job (or subsystem or system)
is not cancelled. 1=The job (or subsystem or
system) is cancelled. If used, the return variable
must be specified as *CHAR LEN(1).
RTVJOBA2B Command parameters *CMD
----------------------------
JOB The job name of the job to be retrieved. * is the
default for the current job. A fully qualified job
name must be used if the job is not the current job.
DATE The date in job format. This is the date assigned
to the job. It is set by such functions as the
initial JOBD and CHGJOB. The information is only
available if the job is active. If used, the return
variable must be specified as *CHAR LEN(6).
CYMDDATE The date in CYMD format. This is the date assigned
to the job. It is set by such functions as the
initial JOBD and CHGJOB. The information is only
available if the job is active. If used, the return
variable must be specified as *CHAR LEN(7).
LOGCLPGM Whether to log CL programs. A value of *YES or *NO
will be returned. If used, the return variable must
be specified as *CHAR LEN(10).
TIMESLICE The time slice assigned to the job. If used, the
return variable must be specified as *DEC LEN(7 0).
PURGE The 'purge' attribute of the job determines if a job
is eligible to be purged. A value of *YES or *NO
will be returned. If used, the return variable must
be specified as *CHAR LEN(10).
SWS The value of the switches as set for the job. 0s or
1s will be returned for the 8 job switches. If
used, the return variable must be specified as *CHAR
LEN(8).
CHRIDCTL The character identifier control attribute of the
job. If used, the return variable must be specified
as *CHAR LEN(10).
COMPSTS The completion status of the job. Blank = the job
has not completed. 0 = the job completed normally.
1 = the job completed abnormally. If used, the
return variable must be specified as *CHAR LEN(1).
JOBMSGQFL The job message queue full attribute of the job. If
used, the return variable must be specified as *CHAR
LEN(10).
JOBMSGQMX The job message queue maximum size in megabytes. If
used, the return variable must be specified as *DEC
LEN(2 0).
DFTWAIT The default wait time in seconds assigned to the
job. A -1 value is used for *NOMAX. If used, the
return variable must be specified as *DEC LEN(7 0).
LSTSTKPGM The last program in the stack.
If the current job is requested, the program prior
to the current program is returned. For example, if
PGMA calls PGMB which does RTVJOBA2B, the value
returned will be PGMA.
If a job other than the current job is requested,
the function loops until it finds a program that is
not in QSYS. If none exist, the first program in
the stack is returned.
If used, the return variable must be specified as
*CHAR LEN(10).
LSTSTKLIB The library of the program returned for LSTSTKPGM.
If used, the return variable must be specified as
*CHAR LEN(10).
ALWMLTTHD The allow multiple threads option. A value of *YES
or *NO will be returned. If used, the return
variable must be specified as *CHAR LEN(4).
SPLFACN The spooled file action value. A value of *KEEP,
*SYSVAL, or *DETACH will be returned. If used, the
return variable must be specified as *CHAR LEN(10).
LOGOUTPUT The job log output value. A value of *JOGLOGSVR,
*JOBEND, or *PND will be returned. If used, the
return variable must be specified as *CHAR LEN(10).
Restrictions
------------
You must be in the current job or be the user of the job or have
*JOBCTL special authority to access the information from another job.
Prerequisites
-------------
The following TAA Tools must be on your system:
CVTBIN8 Convert binary 8
CVTDTS Convert DTS
RTVPGMSTK2 Retrieve program stack 2
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RTVJOBA2 *CMD TAAJODE QATTCMD
RTVJOBA2A *CMD TAAJODE2 QATTCMD
RTVJOBA2B *CMD TAAJODE3 QATTCMD
TAAJODEC *PGM CLP TAAJODEC QATTCL
TAAJODEC2 *PGM CLP TAAJODEC2 QATTCL
TAAJODEC3 *PGM CLP TAAJODEC3 QATTCL
Structure
---------
RTVJOBA2 Cmd
TAAJODEC CL pgm
RTVJOBA2A Cmd
TAAJODEC2 CL pgm
RTVJOBA2B Cmd
TAAJODEC3 CL pgm
|