BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SuryaKiran
Meteorite | Level 14

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)

 

 

 

Thanks,
Suryakiran
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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?

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

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?

SuryaKiran
Meteorite | Level 14

Disregard this, I totally forgot that file names with '/' can't be created. sometimes I am dumb Man Tongue

Thanks,
Suryakiran

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 553 views
  • 0 likes
  • 2 in conversation