BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am cleaning the 'work' library before the start of the program by using the following code. However, I am getting the  warning message in the log 'WARNING: No matching members in the directory.'

            Can I avoid this or any alternatives where I can delete the existing datasets in the 'work' library before the start of the program? I thought of using it at the end ( but this will not help when the datasets are already there, and it may overwrite my datasets.)

Thank you.

dm 'log;clear;output;clear;odsresults ;clear';
proc datasets lib=work memtype=data kill;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
AhmedAl_Attar
Ammonite | Level 13

@SASuserlot 

This should do it

data _null_;
	set sashelp.vtable(where=(libname='WORK' and MEMTYPE='DATA')) nobs=obs;
	if (obs > 0) then
	  rc = dosubl('proc datasets lib=work memtype=data kill NOLIST NOWARN;run;quit;');
run;

View solution in original post

8 REPLIES 8
AhmedAl_Attar
Ammonite | Level 13
proc datasets lib=work memtype=data kill NOWARN;
quit;
AhmedAl_Attar
Ammonite | Level 13

@SASuserlot 

This should do it

data _null_;
	set sashelp.vtable(where=(libname='WORK' and MEMTYPE='DATA')) nobs=obs;
	if (obs > 0) then
	  rc = dosubl('proc datasets lib=work memtype=data kill NOLIST NOWARN;run;quit;');
run;
AhmedAl_Attar
Ammonite | Level 13
This data step would only run the Proc Datasets step if there were data set(s) in the WORK library.
You can test it by adding a dummy data before the data _null_ step
Tom
Super User Tom
Super User

Use NOLIST option not the NOWARN option.

 

Try this example:

data x; run;
proc datasets lib=work memtype=data nolist kill;
quit;
proc datasets lib=work memtype=data nolist kill;
quit;
1102  data x; run;

NOTE: The data set WORK.X has 1 observations and 0 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


1103  proc datasets lib=work memtype=data nolist kill;
NOTE: Deleting WORK.X (memtype=DATA).
1104  quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


1105  proc datasets lib=work memtype=data nolist kill;
1106  quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
Ksharp
Super User

Try option NODSNFERR .

 

options nodsnferr;
proc datasets lib=work memtype=data kill nolist nodetails;
quit;

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 8 replies
  • 2905 views
  • 4 likes
  • 4 in conversation