Some side notes: If you were not aware, there is a TSO-REXX list that covers all things REXX. Also, you can review what Mark Zelden wrote in his IPLINFO REXX.
To join TSO-REXX if you have not done so, use this URL TSO REXX http://www2.marist.edu/htbin/wlvindex?TSO-REXX To review code written by Mark Zelden, http://www.mzelden.com/mvsutil.html You might get more ideas from Mark's code. Lizette > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of Ricardo Gomez Ramirez > Sent: Sunday, November 29, 2015 9:25 AM > To: [email protected] > Subject: REXX to know the CPU and MSU consumption. > > I am currently programming a REXX to let me know the current consumption of my > system MSU and the 4HRA. So far I have achieved: > > - Get the SysName > - Get the model and type > - Capacity defined for the LPAR's MSU > - 4HRA > - And whether the LPAR is capped or not > > The rexx I would not have invented it, I took fragments of several sites > where the > end all read the Resource Control Table. > > However, one thing that I'd like but I have not found anywhere is how to > extract the > number of MSU's that are active (in use) at that time. The value I'm looking > for is the > one in "MSU Act" column at CPC screen, Option > 3> 3 at RMF Monitor III. > > With this, the specific question is how to know the current number of MSU's a > partition (LPAR) is consuming? > > As support to help others, I share the rexx I'm currently using: > > /* REXX */ > /* Trace ?r */ > /******************************************************************** > */ > CVT = C2d(Storage(10,4)) /* point to CVT */ > RMCT = C2d(Storage(D2x(CVT+604),4)) /* point to RMCT */ > RCT = C2d(Storage(D2x(RMCT+228),4)) /* Resource Control Tbl */ > RMCTCCT = C2d(Storage(D2x(RMCT+4),4)) /* cpu mgmt control tbl */ > > CCVUTILP = C2d(Storage(D2x(RMCTCCT+102),2)) /* CPU Utilization */ > RCTLACS = C2d(Storage(D2x(RCT+196),4)) /* 4 hr MSU average */ > RCTIMGWU = C2d(Storage(D2x(RCT+28),4)) /* Image defined MSUs */ > RCTCECWU = C2d(Storage(D2x(RCT+32),4)) /* CEC MSU Capacity */ > /******************************************************************** > */ > /* The CPU model is stored in packed decimal format with no sign, */ > /* so to make the model printable, it needs to be converted back */ > /* to hex. */ > MODEL = C2d(Storage(D2x(CVT - 6),2)) /* point to cpu model */ > MODEL = D2x(MODEL) /* convert back to hex */ > /******************************************************************** > */ > > CURRDATE = Date('S') > CURRTIME = Time() > SYSNAME = MVSVAR('SYSNAME') > CAPPED = 'N' > > PERCENT = Format((RCTLACS/RCTIMGWU)*100,3,2) > > If RCTLACS <> 0 then do > If RCTLACS >= RCTIMGWU & RCTIMGWU <> RCTCECWU then , > CAPPED = 'Y' > End > > say SYSNAME CURRDATE CURRTIME, > 'CpuModel='MODEL, > 'MSU='RCTIMGWU, > 'CPU_Utyl='CCVUTILP'%', > '4HRA='RCTLACS, > 'Limit='PERCENT'%', > 'Capp?='CAPPED > > Regards. > > > -- > *Ricardo Gomez* > [email protected] ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
