01-10-2017 06:33 AM
I am trying to rename one filr in my sas program using the X command. The file name contains some speical character and spaces?
However the file is not getting renamed. I am using SAs 9;.4
X "RENAME e:\data\Playground\Manjeet\SAS_EG\Bank42\Gamt - trivækst - 2011.egp F345.egp";
I also tried, but no luck. Can any one suggest any other idea to rename the file.
X 'RENAME "e:\data\Playground\Manjeet\SAS_EG\Bank42\Gamt - trivækst - 2011.egp" "F345.egp"';
Thanks in advance!
01-10-2017 06:52 AM
I've tried to simulate the problem here with a dummy file.
X 'RENAME "D:\Temp\Gamt - trivækst - 2011.egp" "F345.egp"';
does work as supposed (Windows 8)
Is the path/file name correct?
Daniel Santos @ www.cgd.pt
01-10-2017 07:56 AM - edited 01-10-2017 07:58 AM
Are you sure that the SAS process runs in the same context in which Enterprise Guide is running (local SAS, same user)?
To verify that, I'd run
filename oscmd pipe 'dir e:\data\Playground\Manjeet\SAS_EG\Bank42 2>&1'; data _null_; infile oscmd; input; put _infile_; run;
and look at the log.
01-10-2017 11:54 PM - edited 01-10-2017 11:54 PM
I didn't actually got what you mant by the context.
I ran the code and i am seeing the file in log as:
09/06/2011 16:21 77,974 Garant - tilv‘kst - 2011.egp
Howver the actual file name was:
Gamt - trivækst - 2011.egp
Its different, Please suggest what to do.
01-11-2017 02:23 AM
Since this is on Windows, I suggest using the proper Windows tool (Explorer) to get rid of the non-ASCII characters.
And make it mandatory policy that filenames must not contain non-ASCII characters or blanks.
01-10-2017 10:43 AM
If you are running in a server environment then the path used may be interpretted by the SAS Server as relative to that machine and not looking at your harddrive at all.