Hello,
How do I mask special characters when generating a pdf file in Unix directory. My file name comes from a macro parameter.
data test;
file_name="Test/File";
run;
/* Also files can have unclosed single quote or & or % */
proc sql;
select file_name into: file
from test ;
quit;
ods pdf file="/usr/&file..pdf";
proc print data=sashelp.class;
run;
ods pdf close;
%nrstr() works fine, but when I have '/' it doesn't mask and throws error Physical file doesn't exist. ('/' is treating as another directory in Unix)
I don't think this is a SAS issue. You cannot make a file with a slash in its name.
What name do you want to use instead?
I don't think this is a SAS issue. You cannot make a file with a slash in its name.
What name do you want to use instead?
Disregard this, I totally forgot that file names with '/' can't be created. sometimes I am dumb
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.