IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to extract dataset information?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ualemp7490

New User


Joined: 16 Aug 2005
Posts: 1
Location: Hoffman Estates, Illinois

PostPosted: Tue Aug 16, 2005 3:42 pm
Reply with quote

How can I find out who, when and the time a dataset was last accessed?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 16, 2005 4:34 pm
Reply with quote

From the SMF records.
Back to top
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Wed Aug 17, 2005 8:15 am
Reply with quote

'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
View user's profile Send private message
sundeep_rajasekaran
Warnings : 1

New User


Joined: 18 Feb 2005
Posts: 14

PostPosted: Mon Aug 22, 2005 1:08 pm
Reply with quote

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
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Mon Aug 22, 2005 7:46 pm
Reply with quote

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
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Wed Jul 05, 2006 2:19 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top