I'm trying to delete the below folder created by mistake (not sure how it got created in the first place though).
Folder name: _Error_Report;GOPTIONS NOACCESSIBLE;;*';*
Tried deleting it manually in egp, and also using the below code.
filename deldir "File_Folder&i..";
data _null_;
rc = fdelete('deldir');
put rc=;
msg2=sysmsg();
put msg2=;
run;
Getting the below errors.
rc=20017
msg2=ERROR: Invalid physical name.
Any help to delete this folder is much appreciated.
Thanks,
Ramesh
The code pasted above had that incorrect &i, however I had ran it with out the &i.
I tried the actual path directly to the FDELETE command. Still the same error.
Code:
filename deldir "/usr/apps/.../_Error_Report;GOPTIONS NOACCESSIBLE;;*';*";
data _null_;
rc = fdelete('deldir');
put rc=;
msg2=sysmsg();
put msg2=;
run;
Log:
1 The SAS System 14:22 Monday, July 15, 2019
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program (2)';
4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5 %LET _CLIENTPROJECTPATH='';
6 %LET _CLIENTPROJECTPATHHOST='';
7 %LET _CLIENTPROJECTNAME='';
8 %LET _SASPROGRAMFILE='';
9 %LET _SASPROGRAMFILEHOST='';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=ACTIVEX;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 FILENAME EGSR TEMP;
15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16 STYLE=HTMLBlue
17 STYLESHEET=(URL="file:///D:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")
18 NOGTITLE
19 NOGFOOTNOTE
20 GPATH=&sasworklocation
21 ENCODING=UTF8
22 options(rolap="on")
23 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;
26 filename deldir
26 ! "/usr/apps/../_E
26 ! rror_Report;GOPTIONS NOACCESSIBLE;;*';*";
27 data _null_;
28 rc = fdelete('deldir');
29 put rc=;
30 msg2=sysmsg();
31 put msg2=;
32 run;
INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
30:2 msg2
rc=20017
msg2=ERROR: Invalid physical name.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 349.21k
OS Memory 55364.00k
Timestamp 07/17/2019 01:26:07 PM
Step Count 58 Switch Count 0
Page Faults 0
Page Reclaims 50
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
2 The SAS System 14:22 Monday, July 15, 2019
33
34 GOPTIONS NOACCESSIBLE;
35 %LET _CLIENTTASKLABEL=;
36 %LET _CLIENTPROCESSFLOWNAME=;
37 %LET _CLIENTPROJECTPATH=;
38 %LET _CLIENTPROJECTPATHHOST=;
39 %LET _CLIENTPROJECTNAME=;
40 %LET _SASPROGRAMFILE=;
41 %LET _SASPROGRAMFILEHOST=;
42
43 ;*';*";*/;quit;run;
44 ODS _ALL_ CLOSE;
45
46
47 QUIT; RUN;
48
Thanks,
Ramesh
So you are under unix and the name is probably valid then. There may be special characters there.
You can retrieve the exact name (and process the folder) using one of the many SAS folder-reading utilities on the web, such as this one.
If the server runs does not run under under Windows, you can try something like this:
filename CMD pipe 'rm -rf ""folderpath"" ';
data _null_;
infile CMD;
input;
put _infile_;
run;
and report.
Supposing the server runs under Windows:
Windows does not accept stars as part of folder names, so it looks like Windows allowed untoward things here.
Your best bet is to delete it using its short name.
You can see the short name by running the DIR command with the /X option.
Probably something like del _ERROR~1
We don't have "sas x command" enabled in our site. So I'm afraid I can use pipe commands.
I'm asking myself if the stars in the foldername are creating issues when trying to delete the folder programmatically.
You've posted a picture of the folder. Can't you delete it right there manually with the browser you're using?
No, the manual delete fails too.
Thanks,
Ramesh
Yes, I ended up contacting SAS admin at our site. He was able to get into the server and delete the folder for me.
Thank you for time and continuous ideas. I appreciate it!!
Thanks,
Ramesh
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.