I am using the following Macro that uses filename pipe. But get an error saying invalid option name "dir", etc. I suspect it could be due to the quotes while defining filename and pipe. I guess it recognizes it as an option. I tried to remove the quote, removing %bquote and having just the double quote, but still keep getting the errors.
I am using Windows, but will also be running it remotely on Linux. Any thoughts would be deeply appreciated.
%macro setprogvar(dateval);
%global date;
%let date=&dateval;
%put &date;
%put &dateval;
%let filepath = %bquote("C:\Research\SASDataSets\bulk all data &date");
filename CDR_Bulk pipe "dir &filepath /a:-d-h-s /b /s";
%mend setprogvar;
%setprogvar(20100331);
***LOG************
1 filename CDR_Bulk pipe "dir &filepath /a:-d-h-s /b /s";
---
23
ERROR 23-2: Invalid option name dir.
1 ! filename CDR_Bulk pipe "dir &filepath /a:-d-h-s /b /s";
-
23
ERROR 23-2: Invalid option name a.
The filepath Macro variable needs wrapping in double-quotes as it contains spaces. But as your string is double-quoted, you need double-double-quotes...
Try changing %bquote in your macro to %str().
%Str() works during macro compile time, and should mask the double quote marks.
HTH