BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
t_ar_taat
Quartz | Level 8

Is there any way that I can determine whether the dataset is open or not?

For example, If I open the dataset "x" in the work library,which means there is a window which title bar is "VIEWTABLE: work.X".
In this situation,I exist below code

data work.x;
yy = 1;
run;

There's a ERROR log saying "member-level control" etc., you know.


To avoid this, I'm looking for a way to grasp how this data set is open before casting the dataset(work.x) to DATA step.

 

I know "open" function,which is for open dataset.This time I'm looking "opened" or not.

I asked “Google” but it seems no answer.

sas_dataset_opend.JPG

Sincerely,

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

The first paper in your google search is appplicable isn't it?

Try to open/lock the file and you'all get an error code if file is already opened. 

The FOPEN function()

View solution in original post

4 REPLIES 4
Reeza
Super User

The first paper in your google search is appplicable isn't it?

Try to open/lock the file and you'all get an error code if file is already opened. 

The FOPEN function()

t_ar_taat
Quartz | Level 8

Reeza,Thank  you for your kindness every time.

Oops,actually  if "open" function returns error,it means the dataset is opened.Thanks.

Patrick
Opal | Level 21

In case you've started looking into this because you have some sort of a control/log table where multiple processes insert or update in parallel (so only short lock of the table per process) then have also a look into option FileLockWait as this will make the locking issue "go away" for such use cases.

t_ar_taat
Quartz | Level 8

Thank you,Patrick.
I haven't seen "FILELOCKWAIT" System Option,so I'll check it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1108 views
  • 0 likes
  • 3 in conversation