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.
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?
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.
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";
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
Remove the blank between HEI and the following slash.
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!
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.