- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi ALL,
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
options noxwait;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!
Manjeet
Cheers from India!
Manjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
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 😎
Is the path/file name correct?
Daniel Santos @ www.cgd.pt
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Cheers from India!
Manjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.