PDA

View Full Version : API QUSRJOBI



Bodo Roggenkamp
28-01-04, 14:49
Hallo,

kann mir jemand ein Beispiel für den Aufruf des API's QUSRJOBI geben bzw. einen entsprechenden Link nennen?

Besten Dank im voraus.

Gruß
Bodo

Fuerchau
28-01-04, 15:00
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/qusrjobi.htm

Hier findest du die API-Beschreibung mit allen Parametern.

In QSYSINC/QRPGLESRC (QUSRJOBI) findest du die Definitionen der Strukturen, die du mit COPY einbinden kannst.

TARASIK
28-01-04, 15:12
Hallo Bodo,
ich hoffe dies hilft:

QUSRJOBI - Retrieve Job Information
This API can be called to retrieve information about a specific job. The Qualified Job Name (Job/User/Number) can be passed to the API, or the job Internal Identifier that can be retrieved via the QUSLJOB (List Job) API, or "*" to retrieve the current job details.
Using the Internal ID allows the API to locate the job more quickly. To use this specify *INT as the qualified job parameter.
The API has one Required Parameter Group and one Optional Parameter Group, the format of which is as follows:



+------------------------------------------------------------------------+
|_
| Required Parameter Group:_
| |
| +----+------------------------------------------+--------+-----------+ |
| | 1_ | Receiver Variable_______ _______________ | Output | Char(*) _ | |
| +----+------------------------------------------+--------+-----------+ |
| | 2_ | Length or receiver _____________________ | Input_ | Binary(4) | |
| +----+------------------------------------------+--------+-----------+ |
| | 3_ | Format Name__ __________________________ | Input_ | Char(10)_ | |
| +----+------------------------------------------+--------+-----------+ |
| | 4_ | Qualified Job Name (or * or *INT) ______ | Input_ | Char(26)_ | |
| +----+------------------------------------------+--------+-----------+ |
| | 5_ + Internal Job ID_________________________ + Input_ + Char(16)_ + |
_Optional Parameter:_
| |
| +----+------------------------------------------+--------+-----------+ |
| | 5_ | Error code______________________________ | I/O___ | Char(*)__ | |
| +----+------------------------------------------+--------+-----------+ |
| |
| Threadsafe: Conditional_
| |
+------------------------------------------------------------------------+

Note: Ten Formats are available to retrieve job information, These are:



JOBI0100
This format returns basic performance information about a job. It is faster than the JOBI0150 format and the JOBI0200 format (which also contain performance information). The reason that this format is faster is that it does not touch as many objects, causing less paging when retrieving information about the job._
JOBI0150
This format returns additional performance information, and is slower than the JOBI0100 format. It is similar to the JOBI0200 format, but is faster than that format because there is less paging involved in retrieving the information._
JOBI0200_
This format returns information equivalent to that found on the Work with Active Jobs (WRKACTJOB) command._
JOBI0300
_This format returns job queue and output queue information for a job, as well as information about the submitter's job if the job is a submitted batch job._
JOBI0400
This format primarily returns job attribute types of information, but has other types of information as well._
JOBI0500
This format returns message logging information._
JOBI0600
This format returns information about active jobs only. It is intended to supplement the JOBI0400 format. It retrieves information from several additional objects associated with the job, and therefore, it causes additional paging._
JOBI0700
This format returns library list information for an active job._
JOBI0800_
This format returns signal information for an active job._
JOBI0900
This format returns SQL open cursor information for an active job._

_
By Example
In the following example, the API is executed to retrieve the data similar to that used by WRKACTJOB by using format JOBI0200._
QUSRJOBI Example
See Also:
QUSLJOB_
IBM Book - OS/400 Work Management_ APIs_
D Inf_Len S 4B 0

* The following data structure is then returned to the
* calling program:
D Job_Inf DS 256
d JobName 9 18
d JobUser 19 28
d JobNumber 29 34
d InternalId 35 50
d Status 51 60
D JobType 61 61
D JobSubType 62 62
D Subsystem 63 72
D JobRunPty 73 76b 0
D SystemPool 77 80b 0
D ProcessUnit 81 84b 0
D AuxRequests 85 88b 0
D InteractTrans 89 92b 0
D TotRespTime 93 96b 0
d FunctionType 97 97
D FunctionName 98 107
D ActJobStatus 108 111
D Reserved 112 112
D DBLockWait 113 116b 0
D NDBLockWait 117 120b 0
D MchLockWait 121 124b 0
D TimeDBLckW 125 127
D TimeNDBLckW 128 130
D TimeMchLckW 131 133

* For this program, an the parms are used:
c *entry plist
c parm CTJob 10
c parm CTUser 10
c parm CTJobN 6
c parm Job_Inf 256
* or you could use the Internal Job ID (*char 16) which
* can be gathered from the QUSLJOB (list job) API.

* Qualify the Job Name:
C eval Job_Qual = CTJOB + CTUSER + CTJOBN
c z-add 256 Inf_Len

* Call the API to retrieve the WRKACTJOB info for this job:
C call 'QUSRJOBI'
C parm Job_Inf
C parm INF_Len
C parm 'JOBI0200' Api_Format 8
C parm Job_Qual 26
C parm *BLANKS Job_Int 16

c eval *inlr = *on
c return


Gruss TARASIK

Bodo Roggenkamp
29-01-04, 10:53
Danke für die Info's.

Gruß
Bodo