BookmarkSubscribeRSS Feed
Ksharp
Super User
/*
You also could try copy dataset.
If it was corrupted,you would see an error info in log.
*/

%let path= c:\temp  ;


options validvarname=any validmemname=extend nofmterr ;
filename x pipe %sysfunc(quote(dir "&path.\*.sas7bdat" /s /b));
data _null_;
infile x length=len;
input path $varying200. len;
call execute(catt("options obs=1;data x;set '",path,"';run;"));
run;

options obs=max;
BrianVarney
Fluorite | Level 6

I was recently tasked with this and found that the fastest and easiest way to test a data set is using a procedure like proc print as shown below with the obs=0 option on the data set. No matter how large the SAS data set is, it runs in a fraction of a second and produces no output to the results window.

 

proc print data=<SAS data set name>(obs=0);

run;

 

Or

proc print data="<full file path to sas7bdat file>"(obs=0);

run;

 

The latter method is better in case the file is not a SAS data set and does not show up in the SAS library. It will return a damaged message or a message stating that it is not a SAS data set.

 

Cheers,

  Brian

Brian Varney
Senior Technical Manager, Experis Solutions
269-365-1755 (c)
https://experis.solutions
www.experis.com

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 16 replies
  • 6767 views
  • 16 likes
  • 6 in conversation