iSeries : API QUSRJOBI format JOBI1000

I'm using QUSLJOB API to get the list of all jobs on the system. I'm then passing this job list to API QUSRJOBI format JOBI200 for getting various other information for each job. My problem is to have CPU% for each job. JOBI200 doesn't have any field that return CPU%. I know that the API JOB1000 gives the elapsed time CPU%, but couldn't find any example of it. If anyone can help me with the example of format JOB1000 then I will be grateful.

Thanks.
Aneak DongreAdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
Offset 96 is JOB1000 (Processing unit time used, if less than 2,147,483,647 milliseconds) is CPU time in milliseconds used in JOB1000 is the cumulative amount of CPU time an individual job has used.  To approximate CPU %, you would use this formula:

(CPU Time / Total job runtime) / number of processors in system (or virtual processors in LPAR).

So a job that consumed 10 (10,000ms) seconds of CPU time over 100 seconds of rumtime occupied one CPU for 10% of the time it was running.  If there are 10 CPUs, that means the job consumed 1% of total system CPU during that time.  If there were 4 CPUs, it would be 2.5%.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aneak DongreAdministratorAuthor Commented:
Thank you Gary for your advise. I will implement this in my program.
0
MurpheyApplication ConsultantCommented:
You also can use SQL for this:

SELECT JOB_NAME  from table(QSYS2.ACTIVE_JOB_INFO()) AS info
0
Aneak DongreAdministratorAuthor Commented:
Thank you Gary and Murphey for your advise on the problem.
I've also found that the offset 104 of JOBI1000 format gives the CPU in percent. I've implemented this in my program and it gives the correct results. Thank you all for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.