View previous topic :: View next topic
|
Author |
Message |
ualemp7490
New User
Joined: 16 Aug 2005 Posts: 1 Location: Hoffman Estates, Illinois
|
|
|
|
How can I find out who, when and the time a dataset was last accessed? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
From the SMF records. |
|
Back to top |
|
|
ironmike
New User
Joined: 07 Aug 2005 Posts: 33
|
|
|
|
'Who' comes from SMF records. The SMF Type 62 tells what job opened a VSAM cluster. The SMF Type 17 and 18 can tell you who deleted or renamed a data set. You may not have access to VSAM data, though, so you may have to settle for the 'When' only. The 'When' and other goodies you can get from running this REXX exec:
Code: |
/*REXX*/
ARG DSNAME
/**/
IF SUBSTR(DSNAME,1,1) = "'" THEN NOP
ELSE DSNAME = "'"USERID()"."DSNAME"'"
/**/
X = LISTDSI(DSNAME DIRECTORY)
IF (X ?= 0) THEN DO
SAY 'DATASET ..' DSNAME '.. NOT FOUND'
SAY SYSREASON
EXIT
END
/**/
SAY 'DATASET NAME .. ' SYSDSNAME
SAY 'ORGANIZATION .. ' SYSDSORG
SAY 'RECORD FORMAT .. ' SYSRECFM
SAY 'BLOCKSIZE .. ' SYSBLKSIZE
SAY 'RECORD LENGTH .. ' SYSLRECL
SAY 'DATE CREATED .. ' SYSCREATE
SAY 'VOLUME SERIAL .. ' SYSVOLUME
SAY 'ALLOCATION .. ' SYSALLOC' 'SYSUNITS
SAY 'PRIMARY .. ' SYSPRIMARY' 'SYSUNITS
SAY 'SECONDARY .. ' SYSSECONDS' 'SYSUNITS
SAY 'LAST USED ON .. ' SYSREFDATE
SAY 'USED SO FAR .. ' SYSUSED
IF (SYSDSORG = 'PO') THEN
DO
SAY 'TOTAL MEMBERS .. 'SYSMEMBERS
SAY 'DIR BLK ASSIGNED .. 'SYSADIRBLK
SAY 'DIR BLK USED .. 'SYSUDIRBLK
END
ELSE
NOP
SAY 'CREATED ON .. ' SYSCREATE
SAY 'REFERENCED LAST .. ' SYSREFDATE
|
|
|
Back to top |
|
|
sundeep_rajasekaran Warnings : 1 New User
Joined: 18 Feb 2005 Posts: 14
|
|
|
|
Hi ppl,
I had written a similar code to display the DS information. But the only issue is, im getting the dates in Julian format, how can i display them in calender / gregorian format? when i used the DATE routine, im getting an error (Invalid call to routine).
lemme give you an example : SAY'LAST USED:' DATE('E',SYSREFDATE,'J')
Is this wrong? |
|
Back to top |
|
|
ironmike
New User
Joined: 07 Aug 2005 Posts: 33
|
|
|
|
You have to move the SYSREFDATE characters around a bit to make them conform to the Julian date format, which is expected to be 'yyddd'. Here's one technique that will fixup the SYSREFDATE value, which is in this format as returned by LISTDSI: YYYY/DDD
Code: |
JDATE = SUBSTR(SYSREFDATE,3,2)||SUBSTR(SYSREFDATE,6,3) |
Then you can use your line of code,
Code: |
SAY 'LAST USED:' DATE('E',JDATE,'J') |
and the date will be displayed in the European format you expect... |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Hi,
I used this code of Listdsi it is working fine with dasd data sets
but giving 16 for gdg generations on tape .
is there any other way to get info of gdg generations on tape .
I want to have create date in sequential file finally .
Thanks in advance ,
-Kapil |
|
Back to top |
|
|
|