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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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