Is there any SAS Function to check atleast a dataset present in a location/library?

Accepted Solution Solved
Reply
Contributor
Posts: 46
Accepted Solution

Is there any SAS Function to check atleast a dataset present in a location/library?

Is there any SAS Function to check atleast a dataset present in a location/library?


Accepted Solutions
Solution
‎05-23-2013 02:41 AM
Contributor
Posts: 46

Re: Is there any SAS Function to check atleast a dataset present in a location/library?

Hi, I used the below code to check whether any dataset is exist in a location.. Is there any simpler way to do this??? libname target 'c:\temp\'; %let lib  = target; proc sql noprint; select count(*) into:lcount from sashelp.vtable where upcase(libname)="%upcase(&lib)" and MEMTYPE='DATA'; quit; %put lcount=&lcount;

View solution in original post


All Replies
Super Contributor
Posts: 376

Re: Is there any SAS Function to check atleast a dataset present in a location/library?

Check out the proc sql dictionary.tables table, or the sashelp.vtable view of the same.

Super Contributor
Posts: 644

Re: Is there any SAS Function to check atleast a dataset present in a location/library?

exist() for a SAS dataset, or fexist() for any file or directory

Richard

Solution
‎05-23-2013 02:41 AM
Contributor
Posts: 46

Re: Is there any SAS Function to check atleast a dataset present in a location/library?

Hi, I used the below code to check whether any dataset is exist in a location.. Is there any simpler way to do this??? libname target 'c:\temp\'; %let lib  = target; proc sql noprint; select count(*) into:lcount from sashelp.vtable where upcase(libname)="%upcase(&lib)" and MEMTYPE='DATA'; quit; %put lcount=&lcount;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 190 views
  • 0 likes
  • 3 in conversation