Kirk Wolf asked:

> ... updating a member with statistics is expensive since 
> it would probably have to rewrite the whole directory to
> expand the directory entry length.

Not necessarily.  Regardless, don't worry about it.  It is
not an issue if the data is a PDSE.  If it is an ordinary
PDS, it happens in the cache anyway (these days).  Unless
you have a HUGE directory, it's not likely to be any more
real channel overhead than writing a BIG block or two. So, 
so what? It's the right thing to do, so do it. It costs 
what it costs (however minimal in most instances).

> I'm looking for suggestions on how to create statistics
> for a member that I add or update.

Write (or crib) an assembler subroutine you can call from
your C code that does a STOW.  Get the basic data for the
directory entry from the existing one via BLDL, then add 
the ISPF stats to it, updating its length, and then STOW 
it.  There is no need to (re)write the member('s data). 
Just STOW a new directory entry for it. 

There must be dozens of examples of this sort of thing 
you could find online somewhere to download and adapt.

Better: Write your own. ENTER-OPEN-BLDL-STOW-CLOSE-EXIT.
Lots of folks here have done this, and can help should 
that be needed.

> ... which technique should be the default?

DISP=SHR together with the ISPF ENQ. 

> I guess eventually z/OS legacy file structures will go 
> away :-) 

Not in our lifetime, and probably not in that of those
that come after us. 

Itschak Mugzach wrote:

> ... you can open the PDS as a sequential file and read 
> the directory until you get ZZ (if I remember correctly).

8X'FF'  

> Don't know what will happen if you'll try to write it 
> back..., but I presume that if it conforms to the PDS 
> directory format, it will be OK. 

Nope. No need. (Use STOW instead.) Regardless, this will
not work (unless you're using EXCP, which you can't with
a PDSE, anyway). You'll destroy the HWM TTR in DS1LSTAR,
as well. Bad idea.

--
WB

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to