View previous topic :: View next topic
|
Author |
Message |
nallapureddy
New User
Joined: 27 Jul 2005 Posts: 18
|
|
|
|
Is there any Command in CLIST or REXX to know whether any Particular Dataset is in use or not?
Nallapureddy |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
No. |
|
Back to top |
|
|
jz1b0c
Active User
Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
|
|
|
|
Hi Nallapureddy,
if I have understood correctly...
This will work for you..
TSO WHOHAS 'YOUR.DATASET.NAME' this command is going to tell you
if any job/or user holding 'YOUR.DATASET.NAME' |
|
Back to top |
|
|
bluebird
Active User
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
also if you are trying to edit a sequential ds and somebody is already editing it
you'll get a dataset in use msg . press F1 and you will have a list of users enqueueing your ds. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
I know how to do it in ISPF.
Step1-> TSO ISRDDN or go to option 6 in ISPF.
Step2-> In that give ENQ in the command Line, a screen will popup
Step3-> infront of Minor name prefix option, Enter Dataset name (See the screen shot. )
Step4-> Hit enter
You get the list of all jobs currently using the dataset.
hope it helps. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Most of those suggestions are how to find "who" has the dataset.
The original question is
Quote: |
Is there any Command in CLIST or REXX to know whether any Particular Dataset is in use or not?
|
I may be mis-understanding, but the posted question appears to want to do this in code - not after getting an "in use" message from tso/ispf. . . |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
This is how I would do it:
1. Write REXX exec to capture the dataset name;
2. Invoke edit-macro internally, using the EDIT service;
3. Capture and interpret the return code from the edit-macro.
4. Display a message.
O. |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Use REXX built-in function SYSDSN to find whether the dataset is available for your use.
eg; x = SYSDSN("'proj5.rexx.exec'") |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
ARG FILENAME
FILECODE = SYSDSN("'"FILENAME"'")
IF FILECODE = 'OK'
THEN DO
RTRNCODE = 8
END
ELSE DO
RTRNCODE = 0
END |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10879 Location: italy
|
|
|
|
A few remarks
The poster wants to know how to find out if a dataset is in use..
>> if somebody else has it allocated
WHOHAS is certainly a local tool
SYSDSN will only return info on the dataset existance
a trick that could be used is to
allocate it with disposition OLD in order to get exclusive control on it,
if the allocation fails then it is in use, to find out about users holding it
then other tools are needed.
regards
e.s |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
enrico-sorichetti
you need to read up on SYSDSN as it will tell you if the dataset
is in use. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10879 Location: italy
|
|
|
|
Quote: |
UNAVAILABLE DATASET /* another user has an exclusive ENQ
on the specified data set */
|
The OP asked for dataset in use, not exclusive enq only |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
ISPEXEC QUERYENQ is described in the ISPF Services Guide.
It will tell you if a dataset is in use. |
|
Back to top |
|
|
|