BookmarkSubscribeRSS Feed
Ramesh_165
Obsidian | Level 7

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;;*';*

 

 

Invalid SAS folder.PNG

 

 

 

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

 

15 REPLIES 15
Reeza
Super User
Try using the full path directly in FDELETE? I suspect your FILENAME reference is incorrect, so pass the full file name and see if that works out.

*your file name has _error_report... and &I is usually a number so I don't think it goes where you want it to. You can right click the file, properties and get the path from there.
Ramesh_165
Obsidian | Level 7

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. 

Reeza
Super User
Post your code and log. The folder was created likely because of a missing semi-colon somewhere.
Ramesh_165
Obsidian | Level 7

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

Reeza
Super User
You don't actually have the ... in your path do you?
Ramesh_165
Obsidian | Level 7
No. The dots are for just posting it in the blog purposes.
Reeza
Super User
Well, so far it seems like the issue is still the filename portion. You'll need to figure out how to reference it exactly, the method of copying the path from properties usually works, is that the approach you used?
ChrisNZ
Tourmaline | Level 20

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.

ChrisNZ
Tourmaline | Level 20

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

 

 

Ramesh_165
Obsidian | Level 7

We don't have "sas x command" enabled in our site. So I'm afraid I can use pipe commands.

Patrick
Opal | Level 21

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? 

Ramesh_165
Obsidian | Level 7

No, the manual delete fails too. 

 

 

DeleteFolderGoOptions.PNGDeleteFolderError.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thanks,

Ramesh

Reeza
Super User
Fastest solution is probably to go to the server directly and use an RM (remove) command to delete that file - very carefully of course. If you have x commands enabled (not usually with EG) you may want to consider that anyways.
Ramesh_165
Obsidian | Level 7

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 

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
  • 15 replies
  • 1596 views
  • 3 likes
  • 5 in conversation