We have a simple TSO/e REXX to extract CPU utilization from SDSF. But when executed via OPSOSF, the value returned is incorrect. I tried tracing the OSF execution and I see only 6 lines out of 160 in SDSF are being considered for CPU% calculation.
Release : 14.0
SDSF was defaulting to a specific owner so the DA command was not returning all lines. Setting the owner and prefix before calling SDSF solved this problem.
Resetting the owner and prefix before calling SDSF solved this problem.
Sample code:
/* REXX */
trace i
address TSO
rc = isfCalls('ON')
isfowner = '*'
isfprefix = '*'
address SDSF 'ISFEXEC DA'
cpu = 0
tot = jname.0
say 'total tasks = 'tot
do x = 1 to tot
say jname.x cpupr.x
cpu = cpupr.x + cpu
end
say 'CPU is at 'cpu'%'
exit