IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To know whether any Particular Dataset is in use or not


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nallapureddy

New User


Joined: 27 Jul 2005
Posts: 18

PostPosted: Tue Aug 02, 2005 3:44 pm
Reply with quote

Is there any Command in CLIST or REXX to know whether any Particular Dataset is in use or not?

Nallapureddy
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Aug 02, 2005 6:22 pm
Reply with quote

No.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Fri Aug 05, 2005 10:35 am
Reply with quote

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
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Wed Aug 17, 2005 6:56 pm
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Aug 23, 2005 2:29 pm
Reply with quote

I think that this can be useful:
http://ibmmainframes.com/viewtopic.php?t=3619
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Wed Apr 25, 2007 3:08 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Wed Apr 25, 2007 10:31 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2359
Location: Israel

PostPosted: Thu Apr 26, 2007 12:54 am
Reply with quote

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
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Fri Apr 27, 2007 12:36 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Apr 27, 2007 8:09 pm
Reply with quote

ARG FILENAME

FILECODE = SYSDSN("'"FILENAME"'")

IF FILECODE = 'OK'
THEN DO
RTRNCODE = 8
END
ELSE DO
RTRNCODE = 0
END
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10722
Location: italy

PostPosted: Sat Apr 28, 2007 8:42 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Mon Apr 30, 2007 10:53 pm
Reply with quote

enrico-sorichetti

you need to read up on SYSDSN as it will tell you if the dataset
is in use.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10722
Location: italy

PostPosted: Tue May 01, 2007 12:37 am
Reply with quote

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
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Tue May 01, 2007 7:40 am
Reply with quote

ISPEXEC QUERYENQ is described in the ISPF Services Guide.

It will tell you if a dataset is in use.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Printing a dataset in DUMP format wit... ABENDS & Debugging 2
No new posts Capture GDG Dataset Name JCL & VSAM 10
No new posts Fetch the Dataset names from inside m... TSO/ISPF 18
No new posts what is the DSORG(Datset orgnisation)... JCL & VSAM 8
No new posts IEBGENER is not Creating Member in PD... JCL & VSAM 7
Search our Forums:

Back to Top