How can you tell if a data set is open? 
Author Message
 How can you tell if a data set is open?

I'm working on a program where it would be extremely useful to tell if a particular
data set open to some other address space.  The dataset will not be allocated to
my program but I will have access to it's format 1 dscb. This will also be in a
shared dasd environment so it's possible the dataset may be open on a system
other than the one my program is executing on. Oh, by the way, this will be in a
MVS 4.3 and  DFSMS 1.2 environment.

Thanks in advance, Steve



Tue, 27 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?

Quote:
>I don't know of a way to actually determine if the dataset is open or
>not, but you could use GQSCAN to determine if the dataset is ALLOCATED by
>another address space. Major name = SYSDSN, minor name = the dataset name.

Since GQSCAN will only tell you if the dataset is allocated (and to who) I had already
ruled it out. Knowing whether or not the dataset is allocated doesn't matter - I need
to know if it is open.

Steve



Tue, 27 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?
: I'm working on a program where it would be extremely useful to tell if a particular
: data set open to some other address space.  The dataset will not be allocated to
: my program but I will have access to it's format 1 dscb. This will also be in a
: shared dasd environment so it's possible the dataset may be open on a system
: other than the one my program is executing on. Oh, by the way, this will be in a
: MVS 4.3 and  DFSMS 1.2 environment.

: Thanks in advance, Steve

I don't know of a way to actually determine if the dataset is open or
not, but you could use GQSCAN to determine if the dataset is ALLOCATED by
another address space. Major name = SYSDSN, minor name = the dataset name.

Kurt Deitrick



Tue, 27 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?

Quote:

>I'm working on a program where it would be extremely useful to tell if a particular
>data set open to some other address space.  The dataset will not be allocated to
>my program but I will have access to it's format 1 dscb. This will also be in a
>shared dasd environment so it's possible the dataset may be open on a system
>other than the one my program is executing on. Oh, by the way, this will be in a
>MVS 4.3 and  DFSMS 1.2 environment.

>Thanks in advance, Steve

Perhaps you can describe the reason behind your 'is the dataset open'
requirement.  With a more general understanding of the problem,
help might me more available.

Sam



Wed, 28 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?


:>>I don't know of a way to actually determine if the dataset is open or
:>>not, but you could use GQSCAN to determine if the dataset is ALLOCATED by
:>>another address space. Major name = SYSDSN, minor name = the dataset name.
:>>
:>Since GQSCAN will only tell you if the dataset is allocated (and to who) I had already
:>ruled it out. Knowing whether or not the dataset is allocated doesn't matter - I need
:>to know if it is open.

:>Steve

Once that you know it is allocated you can scan the DEB chains of the
allocating address space (will require SRB)  to see if it is open. One
way is to check the TIOT pointer in the DEB. Of course the situation
can change by the time you get the answer.

Another thing - MVS at some level causes an abend if two users (in
different address spaces) open a PDS for output. I have not
investigated this but it may help.
Binyamin Dissen

In the shadow of Ammunition Hill,
Jerusalem
A small part of Greater Israel
                ^^^^^^^^^^^^^^



Wed, 28 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?
Quote:

>Perhaps you can describe the reason behind your 'is the dataset open'
>requirement.  With a more general understanding of the problem,
>help might me more available.

>Sam

Here's the reason for my question. I'm working on a utility program that will update
the format 1 dscb of a dataset using CVAF. I don't want to update the dscb for an open
dataset for 2 reasons: the update would not be necessary for a dataset that is currently
open, and I don't want to risk changing  and dscb fields that open/close may have
changed prior to my reading the dscb (which I need to do before updating for this
program). If I could tell that the dataset is open I would simply bypass it entirely.
I hope this helps.

Steve



Thu, 29 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?

Quote:


> >you could use GQSCAN to determine if the dataset is ALLOCATED

> Knowing whether or not the dataset is allocated doesn't matter - I need
> to know if it is open.

Besides which, GQSCAN won't help anyway in certain pathological cases --
users of OPENJ for example will go undetected.

Depending on how much work you are willing to go to, you could sit in a
RACF or installation DCB OPEN exit and log OPENs yourself.  CLOSE activity
you could infer from IEFU83 and SMF type 14/15 records, and SSI EOT/EOM
broadcasts.  Naturally, you'd have to do this on every system with access
to the DASD device, and have some way to communicate with other systems.
None of this is very pretty... you'd have to be wayyyy desperate!

--
David Andrews



Thu, 29 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?

Quote:

> Here's the reason for my question. I'm working on a utility program that
will update
> the format 1 dscb of a dataset using CVAF. I don't want to update the
dscb for an open
> dataset for 2 reasons: the update would not be necessary for a dataset
that is currently
> open, and I don't want to risk changing  and dscb fields that open/close
may have
> changed prior to my reading the dscb (which I need to do before updating
for this
> program). If I could tell that the dataset is open I would simply bypass

it entirely.

Steve,

This sounds really ugly. If I were you, I'd avoid all currently allocated
data sets. There are too many ways of missing an open. What if OPEN is in
progress or starts up on another CPU after you check, but while you are
mucking around. What about people who have done a CLOSE TYPE=T. I'd
suggest thinking a lot about why you are updating the DSCB. If you really
have to do your update, then allocate the data set, exclusive; or do the
ENQ. If anybody is doing an OPEN TYPE=J without ENQing they deserve what
they get, when your program runs; assuming of course its not a critical
production job or a CICS transaction, etc. But what the heck, do you
really need your job?

--

1226 Starlit Rd.                  |     (714)494-6086
Laguna Beach, CA 92651-3035       | Fax:(714)494-3072



Thu, 29 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?

Quote:
> I'm working on a program where it would be extremely useful to tell
> if a particular data set open to some other address space.

The data set will be enqueued if open, with major queue name SYSDSN,
and the data set name as the minor queue name.

Quote:
>   [ ...snip... ]       This will also be in a shared dasd
> environment so it's possible the dataset may be open on a system
> other than the one my program is executing on. Oh, by the way, this
> will be in a MVS 4.3 and  DFSMS 1.2 environment.

Our system is single-image. I believe it is fairly easy to read the
system queues across systems; maybe someone else can help with specifics.

---
 t RM 1.3 02158 t



Fri, 30 Jan 1998 03:00:00 GMT  
 How can you tell if a data set is open?


:>> I'm working on a program where it would be extremely useful to tell
:>> if a particular data set open to some other address space.

:>The data set will be enqueued if open, with major queue name SYSDSN,
:>and the data set name as the minor queue name.

:>>   [ ...snip... ]       This will also be in a shared dasd
:>> environment so it's possible the dataset may be open on a system
:>> other than the one my program is executing on. Oh, by the way, this
:>> will be in a MVS 4.3 and  DFSMS 1.2 environment.

:>Our system is single-image. I believe it is fairly easy to read the
:>system queues across systems; maybe someone else can help with specifics.

:>---
:> t RM 1.3 02158 t
:>                                                                                                                

Not true. SYSDSN merely means that it is allocated.
Binyamin Dissen

In the shadow of Ammunition Hill,
Jerusalem
A small part of Greater Israel
                ^^^^^^^^^^^^^^



Fri, 30 Jan 1998 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. How to tell if I can open a file or not

2. Q: How to tell ASCII vs Numeric Data

3. What Problems Am I Setting Myself Up For???

4. how to compile and a set of .prg file I am getting this warning

5. I am having problems setting the page break through Active X

6. open() error ---- what am I missing?

7. I am wishing to read quickbooks data files with C5.5

8. CA Cans VO ?

9. It's not bad canned meat...

10. It's not bad canned meat...

11. It's not bad canned meat...

12. Using CGI module with 'canned queries'

 

 
Powered by phpBB® Forum Software