BookmarkSubscribeRSS Feed
LauriB
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 /hei2015.score.macro.sas';

 

WARNING: Physical file does not exist, H:\HardDrive5\Laptop Backup 7-13-14\HEI \hei2015.score.macro.sas.

ERROR: Cannot open %INCLUDE file H:/HardDrive5/Laptop Backup 7-13-14/HEI /hei2015.score.macro.sas.

6 REPLIES 6
Tom
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?

SASKiwi
PROC Star

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.

LauriB
Fluorite | Level 6
Thanks for the response. It is not running on a remote server.
SASKiwi
PROC Star

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\hei2015.score.macro.sas";
AliceCheng
Fluorite | Level 6

Have you try to rename hei2015.score.macro.sas to hei2015_score_macro.sas and update the program with the new name?  Will that work?

 

Regards,

 

Alice Cheng

 

  

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 6 replies
  • 471 views
  • 2 likes
  • 5 in conversation