BookmarkSubscribeRSS Feed
caroline_rg
Fluorite | Level 6

Hi, 

 

I have CSV files for all my data. For one of them, I am missing some data from one experimental unit (the sample was damaged, not all the work was able to be completed on it). 

 

What should I put so SAS will know to not include that sample in the analysis? It's not 0, it just doesn't exist. 

 

Thank you!

Caroline 

1 REPLY 1
Patrick
Opal | Level 21

SAS function FILEEXIST() allows to verify for the existence of an external file by its physical name.

Here some sample code:

%let myfile=C:\temp\test folder\testfile1.txt;
%if %sysfunc(fileexist(&myfile)) %then 
  %do;
    data _null_;
      put "file exists: &myfile";
    run;
  %end;
%else
  %do;
    data _null_;
      put "file does not exist: &myfile";
    run;
  %end;

We would need to see your actual code to give you more targeted advice for you specific code.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 252 views
  • 0 likes
  • 2 in conversation