Here is something I wrote a while back. (I pulled out some proprietary code,
but this should work).
Enjoy.
Ren
Example to test:
/* REXX */?
pds_nam = 'AAAA.BBBBBBB.CCCCCCC'
mbrnam = 'CCC'
m_dat_4 = '2014/11/07'
c_dat_4 = '2014/11/07'
c_dat = Substr(c_dat_4,3)
m_dat = Substr(m_dat_4,3)
m_tim = '14:51:11'
use_r = 'ABCDEF'
xx = F@UPDSTA('ONLINE' pds_nam mbrnam m_dat m_dat_4 m_tim c_dat c_dat_4 use_r)
Exit
Code:
/* REXX - MEMBER: F@UPDSTA - 08/15/16 11:15:41 <=== LAST UPDATE */
/*=============================================================================
F@UPDSTA
Description: Function - Update/create PDS Member stats from passed info
Purpose:
Will update or create member stats for the member: mbrnam, in the pds:
pds_nam.
Usage:
xx = F@UPdsta(‘ONLINE’ pds_nam mbrnam m_dat m_dat_4 m_tim c_dat c_dat_4
use_r)
Note: m_dat, m_dat_4, m_tim c_dat and c_dat_4 can be spaces
use_r is the RACF ID
If m_dat and m_dat_4 and m_tim are populated they will be used and c_dat
and c_dat_4 will be unchanged
cc = 0 for normal completion
cc = 16 if missing pds or member name
cc = nn for other errors
=============================================================================*/
Arg type pds_nam mbrnam m_dat m_dat_4 m_tim c_dat c_dat_4 use_r
Parse Source . . cmdnam .
If pds_nam = '';Then Signal Err_Missing_PDS_NAME
If mbrnam = '';Then Signal Err_Missing_MBRNAM
dd_nam = 'STATSPDS'
zerrhm = 'ISR00003'
zerralrm = 'YES'
pds_nam = Strip(Translate(pds_nam,"","'")) /* strip quotes */
If Msg() <> 'OFF';Then x = Msg('OFF')
"FREE FI("dd_nam")"
"FREE DATASET('"pds_nam"')"
"ALLOC FI("dd_nam") DA('"pds_nam"') SHR"
cc = rc
If cc <> 0;Then do
x = Msg('ON')
Trace 'R'
"ALLOC FI("dd_nam") DA('"pds_nam"') SHR"
cc = rc
Trace 'O'
If Msg() <> 'OFF';Then x = Msg('OFF')
If cc <> 0;Then Signal Err_AllOC
End
Address "ISPEXEC" "LMINIT DATAID(DATAID01) DDNAME("dd_nam") ENQ(MOD)"
cc = rc
If cc <> 0;Then Signal Err_Lminit
Address "ISPEXEC" "LMOPEN DATAID("dataid01") OPTION(INPUT)"
cc = rc
If cc <> 0;Then Signal Err_Exit
Call Get_Existing_Stats
Call Update_Stats
Z99:
Address "ISPEXEC" "LMMLIST DATAID("dataid01") OPTION(FREE)"
dd = rc
Address "ISPEXEC" "LMCLOSE DATAID("dataid01")"
dd = rc
Address "ISPEXEC" "LMFREE DATAID("dataid01")"
dd = rc
"FREE FI("dd_nam")"
"FREE DATASET('"pds_nam"')"
Return cc
Get_existing_stats:
Address "ISPEXEC" "LMMLIST DATAID("dataid01")",
"MEMBER("mbrnam")",
"STATS(YES)",
"PATTERN("mbrnam")",
"OPTION(LIST)"
cc = rc
If cc = 4;Then do
mdate = '????/??/??'
mtime = '??:??:??'
c_dat = ''
m_dat = ''
c_dat_4 = ''
m_dat_4 = ''
m_tim = ''
zlcnorc = ''
zlinorc = ''
use_r = ''
cc = 0
End /* of cc = 4 */
If c_dat = '';Then do
If zlcdate = 'ZLCDATE',
| zlcdate = '';Then flcdate =''
Else flcdate = zlcdate
End
Else flcdate = c_dat
If m_dat = '';Then do
If zlmdate = 'ZLMDATE',
| zlmdate = '';Then flmdate =''
Else flmdate = zlmdate
End
Else flmdate = m_dat
If c_dat_4 = '';Then do
If zlc4date = 'ZLC4DATE';Then flc4date = ''
Else flc4date = zlc4date
End
Else flc4date = c_dat_4
If m_dat_4 = '';Then do
If zlm4date = 'ZLM4DATE';Then flm4date = ''
Else flm4date = zlm4date
End
Else flm4date = m_dat_4
If m_tim = '';Then do
If zlmtime = 'ZLMTIME';Then flmtime = ''
Else flmtime = zlmtime
End
Else flmtime = m_tim
If zlcnorc = 'ZLCNORC';Then flcnorc = ' '
Else flcnorc = Right(zlcnorc,8,' ')
If zlinorc = 'ZLINORC';Then flinorc = ' '
Else flinorc = Right(zlinorc,8,' ')
If use_r = '';Then do
If zluser = 'ZLUSER';Then fluser = ' '
Else fluser = zluser
End
Else fluser = use_r
If zlvers = 'ZLVERS';Then flvers = ' '
Else flvers = zlvers
If zlmod = 'ZLMOD';Then flmod = ' '
Else flmod = zlmod
If zlsclm = 'ZLSCLM';Then flsclm = ' '
Else flsclm = zlsclm
ver1 = flvers
mod1 = flmod
cdate = flcdate
mdate = flmdate
mtime = flmtime
csize = Strip(flcnorc)
isize = Strip(flinorc)
user = fluser
cdate4= flc4date
mdate4= flm4date
If Datatype(csize) = 'NUM';Then do
If datatype(isize) = 'NUM';Then do
mrecs = csize - isize
End
Else mrecs = 0
End
Else mrecs = 0
If mrecs < 1;Then do
mrecs = 1
End
Return
Update_Stats:
Address "ISPEXEC" "LMMSTATS DATAID("dataid01") MEMBER("mbrnam")",
"VERSION("ver1")",
"MODLEVEL("mod1") CREATED("cdate") MODDATE("mdate")",
"MODTIME("mtime") CURSIZE("csize") INITSIZE("isize")",
"MODRECS("mrecs") USER("user") CREATED4("cdate4")",
"MODDATE4("mdate4")"
cc = rc
If cc <> 0;Then Signal Err_LMMSTATS_B
Return
Err_Missing_PDS_NAME:
zerrsm = ''
zerrlm = 'The PDS_NAME is missing.',
'This function requires a PDS_NAME and a MEMBER name.'
cc = 16
Signal Err_Exit
Err_Missing_MBRNAM:
zerrsm = ''
zerrlm = 'The MEMBER NAME is missing.',
'This function requires a MEMBER name.'
cc = 16
Signal Err_Exit
Err_LMINIT:
zerrsm = ''
zerrlm = 'An error, RC =' cc,
'occurred trying to:',
'"ISPEXEC" "LMINIT DATAID(DATAID01) DATASET('pds_nam') ENQ(SHRW)"',
'The following messages apply:' zerrsm zerrlm
Signal Err_Exit
Err_LMMLIST2:
zerrsm = ''
zerrlm = 'An error, RC =' cc,
'occurred trying to:',
'"ISPEXEC" "LMINIT DATAID(DATAID01) DATASET('pds_nam') ENQ(SHRW)"',
'The following messages apply:' zerrsm zerrlm
Signal Err_Exit
Err_Exit_LMMLIST:
zerrlm = 'An LMMLIST Error has occurred. Dataset is:' pds_nam'.',
'DATAID01 is' dataid01', MOD is' mbrnam'.',
'Return code is:' cc,
'The following messages apply:' zerrlm zerrsm
zerrsm = ''
Signal Err_Exit
Err_LMMSTATS_B:
zerrlm = 'An LMMLIST Error has occurred. Dataset is:' pds_nam'.',
'DATAID01 is' dataid01', MOD is' mbrnam'.',
'Return code is:' cc,
'The following messages apply:' zerrlm zerrsm
zerrsm = ''
Signal Err_Exit
Err_Alloc:
zerrsm = ''
zerrlm = 'An error, RC =' cc,
'occurred trying to allocate DD' dd_nam 'to' pds_nam 'as follows:',
"ALLOC FILE("dd_nam") DA("pds_nam") SHR"
Signal Err_Exit
Err_Alloc_OLd:
zerrsm = ""
zerrlm = "Allocation error on:",
"ALLOC FILE("fi_nam") DA('"pds_nam_mem"') OLD"
Signal Err_Exit
Err_Exit:
zerrlm = zerrlm 'This message was issued from F@UPDSTA.',
'Parms were: pds_nam =' pds_nam', and member =' mbrnam'.'
If type = 'BATCH';Then Say zerrlm
Else Address "ISPEXEC" "SETMSG MSG(ISRZ002)"
Signal Z99
Ren
Ext 1448
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Elardus Engelbrecht
Sent: Friday, July 07, 2017 11:11 AM
To: [email protected]
Subject: Re: Friday question: ISPF Statistics Manipulation
IMPORTANT!! - External Content - Please use caution.
John McKown wrote:
>There are no control possible for this.
There are some control. ISPCCONFIG can be used to FORCE stats using module
ISPCFIGU, but hahahahahaha, override it with option =3.5 as the OP said.
>The ISPF statistics are simply data in the "user data area" portion of a
>member's directory entry.
True. Those stats are just screen ornaments. Beautiful, but useless... They're
really speedhumps on a racetrack...
>Bottom line: ISPF statistics are NOT ANY GOOD for any kind of security
>orauditing purposes. User can update them easily using 3.5 and you can't stop
>them.
Activate logging using SMF and use RACF to monitor member usage. Not the
overhead worth...
Groete / Greetings
Elardus Engelbrecht
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected]<mailto:[email protected]> with the message:
INFO IBM-MAIN
The information contained in this message is proprietary and/or confidential.
If you are not the intended recipient, please: (i) delete the message and all
copies; (ii) do not disclose, distribute or use the message in any manner; and
(iii) notify the sender immediately. In addition, please be aware that any
message addressed to our domain is subject to archiving and review by persons
other than the intended recipient. Thank you.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN