Troubleshooting
Problem
This document contains information on determining what job took the most processor time.
Resolving The Problem
This document contains information on determining which job took the most processor time.
Message CPF1164 in the history log. It provides information to determine how many processor seconds a job took to complete.
To find this information, use SQL to organize it. For example, do the following:
When the SQL statement is changed, many other things can also be queried out.
Note: The SQL is provided as-is.
Message CPF1164 in the history log. It provides information to determine how many processor seconds a job took to complete.
To find this information, use SQL to organize it. For example, do the following:
When the SQL statement is changed, many other things can also be queried out.
Note: The SQL is provided as-is.
| 1. | Use the DPSLOG command to output information from the history log. Ensure the correct date and time range is provided. On the IBM i command line, type the following: DSPLOG OUTPUT(*PRINT) MSGID(CPF1164) Press the Enter key. |
| 2. | To create a file in a library that you can move the spooled file data, on the IBM i command line, type the following: CRTPF FILE(LIB/CPF1164) RCDLEN(135) SIZE(*NOMAX) where LIB can be any library. The size of the physical file should be set to 135. Press the Enter key. |
| 3. | To copy the spooled file into the physical file created in Step 2, on the IBM icommand line, type the following: CPYSPLF FILE(QPDSPLOG) TOFILE(LIB/CPF1164) SPLNBR(*LAST) Press the Enter key. |
| 4. | Use an SQL statement to get out the information you are interested in. Refer to the following examples. |
| 4A. | This statement shows the job information and the processor seconds, sorting the greatest amount of seconds to the top: with tempa as ( select position(';' in CPF1164) as psc, position('seconds' in CPF1164) as psec, position('Job' in CPF1164) as pjob, position('ended' in CPF1164) as pend, CPF1164 from lib/CPF1164 where substr(CPF1164,1,7) = 'CPF1164' ) select substr(substr(CPF1164, PJOB+4, PEND - PJOB -5),1,28) as JOB, int(substr(CPF1164,PSC+2,PSEC-PSC-3)) as PROCESSOR_SECONDS from tempa order by Processor_seconds desc with example results of: JOB PROCESSOR_SECONDS 988111/ACHINO/GTSKWX 646 988125/ACHINO/GTSKSX 620 988022/LARSON/QPADEV000K 411 988058/PEACEX/QEZDKWKMTH 148 988052/QNOTES/DESIGNX 46 987950/QSYS/CRTPFRDTA 38 |
| 4B. | This statement will show the number of processor seconds sorted by user profile: with tempa as ( select position(';' in CPF1164) as psc, position('seconds' in CPF1164) as psec, position('Job' in CPF1164) as pjob, position('ended' in CPF1164) as pend, CPF1164 from lib/CPF1164 where substr(CPF1164,1,7) = 'CPF1164' ), tempb as (select substr(CPF1164,pjob+11,24) as JOBPRF, substr(substr(CPF1164, PJOB+4, PEND - PJOB -5),1,28) as JOB, int(substr(CPF1164,PSC+2,PSEC-PSC-3)) as PROCESSOR_SECONDS from tempa ), tempc as (select position('/' in JOBPRF) as p2sl, JOBPRF, PROCESSOR_SECONDS from tempb ), tempd as (select substr(JOBPRF,1,p2sl-1) as USRPRF, PROCESSOR_SECONDS from tempc ) select USRPRF, count(usrprf) as Num_of_jobs, sum(PROCESSOR_SECONDS) from tempd group by USRPRF order by sum(PROCESSOR_SECONDS) desc with example results of: USRPRF NUM_OF_JOBS SUM ACHINO 5 1,269 CARSON 2 412 MOTES 57 261 PASTONI 1 148 |
| 4C. | This statement shows the number of processor seconds sorted by job name: with tempa as ( select position(';' in CPF1164) as psc, position('seconds' in CPF1164) as psec, position('Job' in CPF1164) as pjob, position('ended' in CPF1164) as pend, CPF1164 from lib/CPF1164 where substr(CPF1164,1,7) = 'CPF1164' ), tempb as (select substr(CPF1164,pjob+11,24) as JOBPRF, substr(substr(CPF1164, PJOB+4, PEND - PJOB -5),1,28) as JOB, int(substr(CPF1164,PSC+2,PSEC-PSC-3)) as PROCESSOR_SECONDS from tempa ), tempc as (select position('/' in JOBPRF) as p2sl, position('end' in JOBPRF) as p2end, JOBPRF, PROCESSOR_SECONDS from tempb ), tempd as (select substr(JOBPRF,p2sl+1,p2end - p2sl - 2) as JOB_NAME, PROCESSOR_SECONDS from tempc ) select JOB_NAME, count(JOB_NAME) as Num_of_jobs, sum(PROCESSOR_SECONDS) from tempd group by Job_NAME order by sum(PROCESSOR_SECONDS) desc with example results of: JOB_NAME NUM_OF_JOBS SUM GETSK 2 1,266 TERISK 40 411 GATHERER 1 148 DESIGN3 3 72 |
| 4D. | If there was such a bad system performance that the system was IPLed, you could also look for all jobs that were active at the time the system IPLed by changing the SQL statement from Step 4A to look for the RC/70. Ensure the date and time range in Step 1 is large enough. with tempa as ( select position(';' in CPF1164) as psc, position('seconds' in CPF1164) as psec, position('Job' in CPF1164) as pjob, position('ended' in CPF1164) as pend, position('code' in CPF1164) as pec, CPF1164 from lib/CPF1164 where substr(CPF1164,1,7) = 'CPF1164' ) select substr(substr(CPF1164, PJOB+4, PEND - PJOB -5),1,28) as JOB, int(substr(CPF1164,PSC+2,PSEC-PSC-3)) as PROCESSOR_SECONDS from tempa where substr(CPF1164,pec+5,2) = '70' order by Processor_seconds desc with example results of: JOB PROCESSOR_SECONDS 987952/ZAPPER/QDOMINO 5,786,227 988061/QPM/PMCHK 172 |
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000C4BAAU","label":"IBM i"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.3.0;7.4.0;7.5.0"}]
Historical Number
346818975
Was this topic helpful?
Document Information
Modified date:
02 April 2025
UID
nas8N1015996