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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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