Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

With REXX, is one able to pull last modification date (date/time) on a DSN?

606 views
Skip to first unread message

Wagner, David --- Senior Programmer Analyst --- CFS

unread,
Jul 22, 2010, 11:31:35 AM7/22/10
to
I am doing some research and trying to figure out an approach
for some processing that I need to do.

With REXX, can I get the last modification of a DSN ( basically
a flat file format only which could be a GDG or normal flat file)?

Also can one identify if a dsn is open for read or update???

Thanks.

Wags ;)
David R. Wagner
Senior Programmer Analyst
FedEx Services
1.719.484.2097 Tel
1.719.484.2419 Fax
1.408.623.5963 Cell
http://Fedex.com/us

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Lizette Koehler

unread,
Jul 22, 2010, 11:41:37 AM7/22/10
to
Are the files VSAM, NON VSAM or TAPE?

And I would probably use SMF records to do this rather than REXX.

Lizette

Wagner, David --- Senior Programmer Analyst --- CFS

unread,
Jul 22, 2010, 11:48:41 AM7/22/10
to
>-----Original Message-----
>From: TSO REXX Discussion List [mailto:TSO-...@vm.marist.edu] On Behalf Of
>Lizette Koehler
>Sent: Thursday, July 22, 2010 9:39
>To: TSO-...@vm.marist.edu
>Subject: Re: [TSO-REXX] With REXX, is one able to pull last modification
>date (date/time) on a DSN?
>
>Are the files VSAM, NON VSAM or TAPE?
>
>And I would probably use SMF records to do this rather than REXX.
I apologize, but they are non vsam files.
Ok, so when you say you would use smf, where would I pickup on this type of processing for a dsn or set of dsn's. If searching the internet, what would be a proper search criteria? If looking into the IBM website, what would be a proper place to look?

Sorry for the ignorance..

Gilbert C Cardenas

unread,
Jul 22, 2010, 12:04:24 PM7/22/10
to
Another option is to use DCOLLECT and SORT/SAS to report on the 'D' record type. It contains all dataset types (vsam, gdg, library, etc.) the dataset creation's date, expiration date, last referenced date and last backed up date.
It does not however tell you whether it is open for read or update.

This e-mail (and any attachments) may contain information that is confidential and/or protected by law. Any review, use, distribution or disclosure to anyone other than the intended recipient(s) is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and delete all copies of this message.


Robert Zenuk

unread,
Jul 22, 2010, 1:25:13 PM7/22/10
to
Here is a quick and dirty way to get it with REXX and ISPF services...

000001 /* rexx */
000002 call status 'YOUR FIRST.SEQ.DSN'
000003 call status 'YOUR.SECOND.SEQ.DSN'
000004 call status 'YOUR FIRST.GDG.G000V00'
000005 call status 'YOUR.SECOND.GDG.G000V00'
000006 call status 'SOME.OTHER.DNS'
000007 exit 0
000008 status: arg dsn .
000009 if dsn = '' then
000010 do
000011 say 'DSN missing, RC=12'
000012 exit 12
000013 end
000014 dsn = "'"strip(dsn,"B","'")"'"
000015 qname = 'SYSDSN'
000016 asname = '*'
000017 address ISPEXEC
000018 "CONTROL ERRORS RETURN"
000019 "DSINFO DATASET("dsn")"
000020 if RC <> 0 then say dsn 'not found, RC='RC
000021 dsn = strip(dsn,"B","'")
000022 "QUERYENQ TABLE(QUERYENQ) QNAME(QNAME) RNAME(DSN)",
000023 "XSYS REQ("asname")"
000024 ENQRC = RC
000025 select
000026 when ENQRC <= 2 then
000027 do
000028 "TBSKIP QUERYENQ"
000029 "TBGET QUERYENQ"
000030 end
000031 when ENQRC = 8 then
000032 do
000033 zendisp = 'NOTINUSE'
000034 zenjob = 'NOHOLDER'
000035 end
000036 otherwise say 'QUERYENQ error RC='ENQRC
000037 end
000038 say left(dsn,44) zdsrdate left(zendisp,8) zenjob
000039 "TBEND QUERYENQ"
000040 return

In a message dated 7/22/2010 9:04:23 A.M. US Mountain Standard Time,

Wagner, David --- Senior Programmer Analyst --- CFS

unread,
Jul 22, 2010, 1:37:36 PM7/22/10
to
>-----Original Message-----
>From: TSO REXX Discussion List [mailto:TSO-...@vm.marist.edu] On Behalf Of
>Robert Zenuk
>Sent: Thursday, July 22, 2010 11:25
>To: TSO-...@vm.marist.edu
>Subject: Re: [TSO-REXX] With REXX, is one able to pull last modification
>date (date/time) on a DSN?
>
Thanks, but it will take me a while to digest and try it out.

Will let the list know how it goes..

Again, thanks for the help and insight..

Vitonis, Tony

unread,
Jul 22, 2010, 1:57:03 PM7/22/10
to
ZDSRDATE is a last-referenced date, not a last-modified date. To get
just that information, here's something quicker and dirtier:

/* REXX */

ADDRESS ISPEXEC "DSINFO DATASET("ARG(1)")"
SAY ZDSRDATE

--> From: Wagner, David

Thanks, but it will take me a while to digest and try it out.

Will let the list know how it goes..

Again, thanks for the help and insight..

-->From: Robert Zenuk

Here is a quick and dirty way to get it with REXX and ISPF services...

000001 /* rexx */
000002 call status 'YOUR FIRST.SEQ.DSN'
000003 call status 'YOUR.SECOND.SEQ.DSN'
000004 call status 'YOUR FIRST.GDG.G000V00'
000005 call status 'YOUR.SECOND.GDG.G000V00'
000006 call status 'SOME.OTHER.DNS'
000007 exit 0
000008 status: arg dsn .
000009 if dsn = '' then
000010 do
000011 say 'DSN missing, RC=12'
000012 exit 12
000013 end
000014 dsn = "'"strip(dsn,"B","'")"'"
000015 qname = 'SYSDSN'
000016 asname = '*'
000017 address ISPEXEC
000018 "CONTROL ERRORS RETURN"
000019 "DSINFO DATASET("dsn")"
000020 if RC <> 0 then say dsn 'not found, RC='RC
000021 dsn = strip(dsn,"B","'")

000022 "QUERYENQ TABLE(QUERYENQ) QNAME(QNAME) NAME(DSN)",


000023 "XSYS REQ("asname")"
000024 ENQRC = RC
000025 select
000026 when ENQRC <= 2 then
000027 do
000028 "TBSKIP QUERYENQ"
000029 "TBGET QUERYENQ"
000030 end
000031 when ENQRC = 8 then
000032 do
000033 zendisp = 'NOTINUSE'
000034 zenjob = 'NOHOLDER'
000035 end
000036 otherwise say 'QUERYENQ error RC='ENQRC
000037 end
000038 say left(dsn,44) zdsrdate left(zendisp,8) zenjob
000039 "TBEND QUERYENQ"
000040 return

----------------------------------------------------------------------

Robert Zenuk

unread,
Jul 22, 2010, 2:53:52 PM7/22/10
to
Actually I just realized you asked for last modification date not last
referenced date... I'm not sure if anything keeps last modification date for
sequential files... Depending on your SMS environment, you might be able
to determine the last modification date based on the HSM last backup date
using the HLIST command...
Anyone else? Is the last modification date for a dataset kept anywhere?

Rob

In a message dated 7/22/2010 10:37:23 A.M. US Mountain Standard Time,
david....@FEDEX.COM writes:

>-----Original Message-----
>From: TSO REXX Discussion List [mailto:TSO-...@vm.marist.edu] On Behalf
Of
>Robert Zenuk
>Sent: Thursday, July 22, 2010 11:25
>To: TSO-...@vm.marist.edu
>Subject: Re: [TSO-REXX] With REXX, is one able to pull last modification
>date (date/time) on a DSN?
>

>Here is a quick and dirty way to get it with REXX and ISPF services...
>
>000001 /* rexx */
>000002 call status 'YOUR FIRST.SEQ.DSN'
>000003 call status 'YOUR.SECOND.SEQ.DSN'
>000004 call status 'YOUR FIRST.GDG.G000V00'
>000005 call status 'YOUR.SECOND.GDG.G000V00'
>000006 call status 'SOME.OTHER.DNS'
>000007 exit 0
>000008 status: arg dsn .
>000009 if dsn = '' then
>000010 do
>000011 say 'DSN missing, RC=12'
>000012 exit 12
>000013 end
>000014 dsn = "'"strip(dsn,"B","'")"'"
>000015 qname = 'SYSDSN'
>000016 asname = '*'
>000017 address ISPEXEC
>000018 "CONTROL ERRORS RETURN"
>000019 "DSINFO DATASET("dsn")"
>000020 if RC <> 0 then say dsn 'not found, RC='RC
>000021 dsn = strip(dsn,"B","'")

>000022 "QUERYENQ TABLE(QUERYENQ) QNAME(QNAME) RNAME(DSN)",


>000023 "XSYS REQ("asname")"
>000024 ENQRC = RC
>000025 select
>000026 when ENQRC <= 2 then
>000027 do
>000028 "TBSKIP QUERYENQ"
>000029 "TBGET QUERYENQ"
>000030 end
>000031 when ENQRC = 8 then
>000032 do
>000033 zendisp = 'NOTINUSE'
>000034 zenjob = 'NOHOLDER'
>000035 end
>000036 otherwise say 'QUERYENQ error RC='ENQRC
>000037 end
>000038 say left(dsn,44) zdsrdate left(zendisp,8) zenjob
>000039 "TBEND QUERYENQ"
>000040 return
>

Thanks, but it will take me a while to digest and try it out.

Will let the list know how it goes..

Again, thanks for the help and insight..

Wags ;)

>>>----------------------------------------------------------------------
>>>For TSO-REXX subscribe / signoff / archive access instructions,
>>>send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
>>
>>----------------------------------------------------------------------
>>For TSO-REXX subscribe / signoff / archive access instructions,
>>send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
>

>This e-mail (and any attachments) may contain information that is
>confidential and/or protected by law. Any review, use, distribution or
>disclosure
>to anyone other than the intended recipient(s) is strictly prohibited. If
>you are not the intended recipient, please contact the sender by reply
>email
>and delete all copies of this message.
>
>
>

Ken Brick

unread,
Jul 22, 2010, 6:48:01 PM7/22/10
to
On 23/07/2010 04:53 AM, Robert Zenuk wrote:
> Actually I just realized you asked for last modification date not last
> referenced date... I'm not sure if anything keeps last modification date for
> sequential files... Depending on your SMS environment, you might be able
> to determine the last modification date based on the HSM last backup date
> using the HLIST command...
> Anyone else? Is the last modification date for a dataset kept anywhere?
>
> Rob
>
>
Combination of last reference date and dataset modified bit in FMT1 label

Robert Zenuk

unread,
Jul 22, 2010, 8:43:17 PM7/22/10
to
I'm not understanding how to use the FMT1 DSCB DS1DSCHA bit and the last
reference date to determine the last modification date. The bit usually
gets reset by backup products (SMS/HSM/DSS) and the last referenced date will
change for every read-only allocation. Unless you are sampling the last
change bit between each allocation, how would you know when the last
reference date coincides with the last modification? And, if you do not have
backup products resetting the bit, it could have been on for weeks, months or
years...

Help me understand what I am missing.

Looking at SMF 14/15 (if you can afford to collect those and sift through
them), it looks like the DCB/DEB section contains the SMFDEBFL field that
indicates whether the dataset was modified. So, there might be a way to
combine what I provided already along with SMF to get a report if you know how
far back you need to go with the SMF data...

Since the OP was from Fedex, I would suspect your DASD Management group can
help you with a request like this since knowing whether your SMS
environment forces timely backups (each night) after changes is key to knowing when
a change occurred. At that point, scraping the results of an HLIST BCDS
would fill in the last change date to within 24 hours.

If someone has a better approach, please let me know.

Rob

In a message dated 7/22/2010 3:47:38 P.M. US Mountain Standard Time,

0 new messages