BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

hello

data HAVE ;
x=1;
run ;

%let mv_id_table = %sysfunc(open(work.HAVE)); 

proc datasets library=WORK memtype=data nolist;
delete HAVE ;
quit ;

by executing this code, the note is "File WORK.HAVE (memtype=DATA) cannot be deleted because it is in use."

how could I close the HAVE table ?

thanks in advance for your help

regards

Nasser

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
SAS Super FREQ

Close the file before attempting to delete it:

%let rc= %sysfunc(close(&mv_id_table )); 
Check out my Jedi SAS Tricks for SAS Users

View solution in original post

2 REPLIES 2
SASJedi
SAS Super FREQ

Close the file before attempting to delete it:

%let rc= %sysfunc(close(&mv_id_table )); 
Check out my Jedi SAS Tricks for SAS Users
Tom
Super User Tom
Super User

When you open a DATASET (as opposed some generic FILE) with the OPEN() function it returns a reference to that dataset.  So to close it you pass that reference back to the CLOSE() function.

%let rc=%sysfunc(close(&mv_id_table)) ;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 562 views
  • 2 likes
  • 3 in conversation