BookmarkSubscribeRSS Feed
Fluorite | Level 6

I don't understand why it will not recognize this macro. It is in the folder. Any suggestions? Thanks.

%let home = H:\HardDrive5\Laptop Backup 7-13-14\HEI\;

filename Totals '&home\ Data for HEI calc each day.csv';

filename res '&home\Results';

%include 'H:/HardDrive5/Laptop Backup 7-13-14/HEI /';


WARNING: Physical file does not exist, H:\HardDrive5\Laptop Backup 7-13-14\HEI \

ERROR: Cannot open %INCLUDE file H:/HardDrive5/Laptop Backup 7-13-14/HEI /

Super User Tom
Super User

Your first two FILENAME statement cannot work because you are trying to use macro code inside of a quoted string that is bounded by single quote characters.  The macro processor will ignore those strings.  You need to use double quote characters instead to make those string literals.


But the %INCLUDE statement looks ok other than that you are using the wrong delimiter for a WIndow filename.  Windows uses \ and not / between the directory levels.


Are you sure the H drive is mounted on the machine where SAS is running?

Opal | Level 21

If your SAS session is running on a remote SAS server then it won't be able to read your PC's H drive. You need to move the sas program file to a folder accessible by your SAS server.

Fluorite | Level 6
Thanks for the response. It is not running on a remote server.
Opal | Level 21

Try this. Are you really using multiple dots in your SAS macro filename?

%let home = H:\HardDrive5\Laptop Backup 7-13-14\HEI;
filename Totals "&home\Data for HEI calc each day.csv";
filename res "&home\Results";
%include "&home\";
Fluorite | Level 6

Have you try to rename to and update the program with the new name?  Will that work?




Alice Cheng







Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 6 replies
  • 5 in conversation