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 ![]()
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.