Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to extract dataset information?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to extract dataset information?
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

Moderator Team Head


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

PostPosted: Tue Aug 16, 2005 4:34 pm    Post subject: Re: How to extract dataset information?
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    Post subject:
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    Post subject: Re: How to extract dataset information?
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    Post subject:
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    Post subject: Re: How to extract dataset information?
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Obtaining file information pahiker COBOL Programming 25 Tue Sep 27, 2016 7:25 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us