Thank you in advance
Jay
/* ....
Other code ...
...*/
elapsed_seconds = Time(E)
cpu_seconds = Sysvar(SYSCPU)-cpu_seconds
Say 'This REXX has used' cpu_seconds 'CPU-Seconds.' ,
'and' elapsed_seconds 'elapsed Seconds'
Exit 0
Thank you in advance
Jay
--------------------------------------------------------------------------------
This email and any files transmitted with it are intended solely for the
addressee(s) and may be legally privileged and/or confidential. If you have
received this email in error please destroy it and contact the sender, via
our switchboard on +44 (0)20 7623 8000 or via return e-mail. You should not
copy, forward or use the contents, attachments or information in any way.
Any unauthorised use or disclosure may be unlawful. Dresdner Kleinwort
Benson gives no warranty as to the accuracy or completeness of this email
after it is sent over the Internet and accepts no responsibility for changes
made after it was sent. Any opinion expressed in this email may be personal
to the author and may not necessarily reflect the opinions of the Bank or
its affiliates. They may also be subject to change without notice.
--------------------------------------------------------------------------------
shimon.
--
+---------------------------------+
| Shimon Cohen |
| shi...@netvision.net.il |
+---------------------------------+
Jay Pillai wrote:
> Can somebody help me with a REXX program. I would like to find the CPUtime
> of a job and the elapsed time. Is it
> possible to do this with a rexx program. I want to inlcude this program as
> the last step in my JCL and this step should give me the
> CPU time, elapsed time etc.. for the job in which this step is included.
>
C R0,=F'8' . IS THIS WAIT TIME?
BE DOWAIT1 . YES GO FORMAT WAIT TIME
LM R14,R15,ASCBEJST-ASCB(R9) TCTEJST JOB TIME
SRDA R14,12 . SHIFT UNUSED BITS
D R14,=F'10000' . R15=SSSSSS.TH
A R15,WORK . ADD IN PRIOR STEPS CPU TIME
LR R14,R15 . GO AND DROP OFF THE "H"
SRDA R14,32 . SHIFT FOR DIVIDE
D R14,=F'10' . R15=SSSSSS.T
ST R15,CPUTIME . STORE CPU TIME
One Hand Clapping wrote:
> yes, <snip>
Cheers,
Brian.
shimon.
> Can somebody help me with a REXX program. I would like to find the
CPUtime
> of a job and the elapsed time. Is it
> possible to do this with a rexx program. I want to inlcude this program as
> the last step in my JCL and this step should give me the
> CPU time, elapsed time etc.. for the job in which this step is
included.
>
--
+---------------------------------+
| Shimon Cohen |
| shi...@netvision.net.il |
+---------------------------------+
/* REXX exec to call ERBSMFI to extract the in-storage SMF record */
one = '00000001'X
smf_rectype = RIGHT(D2C(79),4,'00'X)
smf_subtype = RIGHT(D2C(2),4,'00'X)
buffer = COPIES('00'x,32767)COPIES('00'x,32767)COPIES('00'x,32767)
buffer = buffer''COPIES('00'x,32767)COPIES('00'x,32767)
bufflen = RIGHT(D2C(LENGTH(buffer)),4,'00'X)
cpu_util = '00000000'X
pagerate = '00000000'X
CALL showhex 'one'
CALL showhex 'smf_rectype'
CALL showhex 'bufflen'
/*--------------------------------------------------------------------*/
/* ADDRESS LINKPGM must be used, because it generates a list of */
/* fullword pointers to the value of each parm, with the '80'x bit on */
/* '80'x bit on in the last pointer in the list. */
/*--------------------------------------------------------------------*/
ADDRESS LINKPGM 'ERBSMFI one smf_rectype smf_subtype buffer bufflen',
'cpu_util pagerate'
SAY 'RC='RC
say 'cpu_util='C2D(cpu_util)
say 'pagerate='C2D(pagerate)
CALL DUMP LEFT(buffer,512)
EXIT: EXIT
DUMP:
ARG _dmpinput
DO _dmpi = 0 BY 16 WHILE _dmpinput <> ''
PARSE VAR _dmpinput 1 _dmpline 17 _dmpinput
_dmphexline = C2X(_dmpline)
_dmpcharline = TRANSLATE(_dmpline,,XRANGE('00'x,'3F'x),'.')
SAY RIGHT(D2X(_dmpi),3),
SUBSTR(LEFT(_dmphexline,32),1,8) SUBSTR(LEFT(_dmphexline,32),9,8),
SUBSTR(LEFT(_dmphexline,32),17,8) SUBSTR(LEFT(_dmphexline,32),25,8),
_dmpcharline
END
RETURN
SHOWHEX:
arg var
SAY RIGHT(var,12) VALUE(var)' length('var')='LENGTH(VALUE(var)),
'hex:'C2X(VALUE(var))
RETURN
Bob Stark [ProTech - When you're serious about Systems Management]
www.protechpts.com
---------------------------------------------------------------------------
---------------------------------------------------------------------------
----------------------------------------------
Jay
Jay Pillai wrote:
> <snip>but I could'nt quite figure out how to get the CPU time for a
> particular job from this code. Any one out there, who could help me to get
> this information from this
> code. <snip>
> say 'cpu_util='C2D(cpu_util)
snip
/* Rexx*/
/* Display Address Space Resource Data using RMF API */
/* Like RMF Monitor II ARD Report */
/* Requirement: RMF. */
/* Platform: TSO OS/390 2.8 and 2.10 */
numeric digits 16 /* 31 bit addressing or 2w */
cvt =c2d(storage(10,4)) /* CVT Ptr */
asvt =c2d(storage(d2x(cvt+556),4)) /* ASVT */
asvtmaxu=c2d(storage(d2x(asvt+516),4)) /* ASVT Max users. */
fullwd='00000000'x
one ='00000003'X
smf_rectype ='0000004F'x /* SMF 79 */
smf_subtype ='00000002'x /* Subtype 2 */
buffer = copies('00'x,176*asvtmaxu) || copies('00'x,400)
bufflen = RIGHT(D2C(LENGTH(buffer)),4,'00'X)
cpu_util = '00000000'X
pagerate = '00000000'X
srm = '00000000'X
m=0
ADDRESS attchpgm 'ERBSMFI one smf_rectype smf_subtype buffer bufflen',
'cpu_util pagerate fullwd srm'
if rc\=0 then do
if rc=16 then say "No data available. Rc="rc
else say "RMF API encountered unexpected Return code. Rc="rc
exit 12
end
/* Heading */
h.1=Time() " SMF79-2 RMFARD Address Space Resource Data ",
date('u')
h.2="ASid Jobname Pos Type Total-CPU Total-Elasp Total-SRM"
h.3="------------------------------------------------------------"||,
"-------------------"
say h.1;say h.2;say h.3
parse var buffer smfheader 'ARD ' . +100 smfbuffer
do while smfbuffer\='' & (m<asvtmaxu)
m=m+1
parse var smfbuffer 1 smfdata +176 smfbuffer
if smfdata==copies('00'x,176) then leave
parse var smfdata 1 asid +2 ,
3 jobname +8 ,
15 cl +2 ,
17 TAS +2 ,
35 TCPU +4 ,
47 EJST +4 ,
51 TSRM +4 ,
55 Csai +4 ,
59 EXCP +2 ,
137 scl +8 ,
155 Rgrp +8 ,
159 tcpc +4 .
asid=c2x(asid)
tas=c2x(tas)
jtype='STC '
if tas='0000' then jtype='JOB '
if tas='0002' then jtype='MNT '
if tas='0003' then jtype='TSO '
if tas='0004' then jtype='ASCH'
if tas='0005' then jtype='OMVS'
tcpu=format(c2d(tcpu),12)
ejst=format(c2d(ejst),12)
tsrm=format(c2d(tsrm),12)
excp=c2x(excp)
list=asid jobname cl' 'jtype tcpu ejst tsrm
say list
end
exit 0
----------
> From: Jay Pillai <Jay_P...@SWISSRE.COM>
> To: TSO-...@VM.MARIST.EDU
> Subject: CPU time and ELAPSED TIME FOR A JOB WITH REXX
> Date: Monday, November 27, 2000 11:08 AM
>
> I found a good solution by Bob Stark in The TSO-REXX Archives. He gets
this
> information from RMF . It is very fast, but I could'nt
> quite figure out how to get the CPU time for a particular job from this
> code.
> Any one out there, who could help me to get this information from this
> code.
>
---------------------------------------------------------------------------