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

Hello,

 

I'm trying to use the rename function (in SAS 9.4) to rename a file, however it appears that because I'm using a forward slash in the new filename, that the rename function will not work. Do you know how I can achieve a forward slash in the new filename please?

 

This is the code that I've been trying to use.

 

data _null_;
  rc=rename("S:\SEP380-201_201_201201001_EoT_999_ET_SIGMA Past Week_std_260123_Feedback.pdf", "S:\SEP380-201_201_201201001_EoT/ET_SIGMA Past Week_std_260123_Feedback.pdf", 'file');
run;

 

Many thanks,

 

Kriss

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Windows does not allow forward slash in file names.

View solution in original post

4 REPLIES 4
Reeza
Super User
Windows does not allow forward slash in file names.
djrisks
Barite | Level 11
Thank you for confirming, at first I thought that I may need to escape the forward slash.
Tom
Super User Tom
Super User

I don't think you can get SAS to do something that the underlying operating system doesn't support.

C:\downloads>echo "hello" > test1.txt

C:\downloads>rename test1.txt "test1/2.txt"
The system cannot find the path specified.

C:\downloads>
djrisks
Barite | Level 11
Thanks for the confimation.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 4 replies
  • 1008 views
  • 2 likes
  • 3 in conversation