BookmarkSubscribeRSS Feed
Opa4ki
Calcite | Level 5
Hi

My issue is that when some process is reading data set i cannot rename it with sas utilities. E.g. "Change statement in datasets procedure". Sas says that "data set XX is in use by user YY" or something like that.

We now overcome this by issuing OS-commands. OS is Solaris. When we want to rename XX, we have macro that do "rm or mv XX".

I wonder, whether SAS actually has some way to do this without me going to issue OS-commands?
5 REPLIES 5
Opa4ki
Calcite | Level 5
And when i try to use 'rename' or 'delete' function like that
data _null_;
sysrc=delete('TABLENAME');
run;
SAS says
The function DELETE is unknown, or cannot be accessed.
Doc_Duke
Rhodochrosite | Level 12
SAS is designed to "play well with others". It's behavior is consistent in not allowing you to rename a dataset while someone else is using it.

Unix was written with the philosophy that the user know what they are doing and will take the consequences of his behavior. If you rename a dataset with with the OS and the other user does another read, their process fails.

I think that you are stuck with using the OS to do the rename. BTW, other OSs will not allow you to do a rename while another process has a file open.
Opa4ki
Calcite | Level 5
Processes in question are in ETL environment. In most cases they read tables only once.
So when they read and processes that builds table can't update table - this is the issue.
While doing UNIX-tied deletes and removes we can update tables well.

It's strange why not to have some options for this case.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You may want to explore the behavior differences with the FILELOCKS system / CONFIG option. The SAS UNIX Companion Guide should have reference information.

Scott Barry
SBBWorks, Inc.
ChrisNZ
Tourmaline | Level 20
>So when they read and processes that builds table can't update table - this is the issue.

A product called SAS/Share exists to manage multi-user table access, so you can read and write (as in update, not delete or rename, see below) tables at the same time

>In most cases they read tables only once. While doing UNIX-tied deletes and removes we can update tables well.

If the table is still locked, it is still being being read, unless the process does bizarre things. Your deleting/renaming will likely cause errors and abort the reading process. If it doesn't, maybe the reading process can release it earlier? Does it use sasfile statements or similar?

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
  • 5 replies
  • 774 views
  • 0 likes
  • 4 in conversation