|
Hello Wanda, > I am having trouble determing where I can retrieve the cpu percentage > used by jobs that have been submitted from a job monitoring menu we have > created. When you say "CPU Percentage" I assume that you mean something like the "CPU%" field of WRKACTJOB? If not, you'll need to clarify what you mean. WRKACTJOB's CPU percentage is based on a time interval. It's the percentage of the total CPU used since the last time you pressed F10 or since the first time you ran WRKACTJOB. Therefore, in order to get the same results as WRKACTJOB, you have to choose a starting time for the CPU interval and at that time call QUSRJOBI with format JOBI1000. Then, at the end of the interval, call with JOBI1000 again to get the percentage over the time that has elapsed. > I have used the format JOBI0200 of QUSRJOBI and the position 80-83 and > 84-87...however this seems to be the entire cpu percentage of all the > jobs in the system. I would like each jobs cpu percentage instead. > I am sure this is possible, but I can not find the correct field. First of all, nothing in QUSRJOBI is a total for the system. It's always per-job, as this is a per-job API. At *offset* 80 of JOBI0200 is the processing time used (which is different from CPU percentage) And at *offset* 84 is the number of auxiliary I/O requests (which is VERY different from CPU percentage) Please make sure you understand the difference between an offset and a position. An offset is always one lower than the position. So offset 80 is position 81. I could just write the code to do this and post it for you to read, but from the way you're asking your questions, it's clear that you don't understand what's going on -- so I'll try to explain it instead: The first thing that you MUST do if you're going to successfully use this API without someone else writing the code for you is to read the manual page for the API. Since you know the name of the API is QUSRJOBI, you can use the API finder to get it to it. The API finder is here: http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/apifinder.htm Under "Search by Name" type QUSRJOBI and click "Go!". The system will return a link to a manual page for that API. One of the first things on the manual page is a listing of the parameters that have to be passed to the API. (And please remember that "Binary(4)" is "10I 0" in RPG! People frequently get that wrong.) Also pay attention to "optional parameter 2" since it's how you reset the performance statistics (like pressing F10 in WRKACTJOB) Then it explains the authorities that you need, and goes on to give more detail on the what the different parameters mean. Under the "Format Name" parameter it gives an overview of what the possible formats are. Since you're interested in performance statistics, you can see here that JOBI1000 is the format that you're looking for. After the parms are detailed, it gives another overview about the different formats, and then goes into the specific details. Since you know that you want JOBI1000, scroll down to the space where it says (in bigger, bold letters) "JOBI1000 Format". There will be a table here showing the different offsets, data types and field names for JOBI1000. In particular, you want to look at offset 104. Remember, offset 104 is positions 105-108. Since it's a "Binary(4)" field, you want to define your RPG field as "10I 0". Hope that helps...
As an Amazon Associate we earn from qualifying purchases.
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.