BookmarkSubscribeRSS Feed
gabonzo
Quartz | Level 8

Hi,

 

while writing a new analysis, I often create lots of temporary debug tables with automatic names, i.e. using _DATA_ as a dataset name.

 

When I want to delete these debug tables in bulk, instead of having to delete them manually, I run a code snippet like this:

 

proc delete data=data1-data200;
run;

In theory, PROC DELETE should not worry if all 200 tables exists or not: if they don't, most of the times it justs deletes what it finds, and issues a warning for what it doesn't find.

 

Very often, though, the procedure crashes with an error log like this:

 

ERROR: The value ÀDATA157DATA158DATA159DATA1 is not a valid SAS name.
ERROR: The value 7DATA168DATA169DATA170DATA17 is not a valid SAS name.
ERROR: The value 74DATA175DATA176DATA177DATA1 is not a valid SAS name.
ERROR: The value DATA181           @      @    is not a valid SAS name.

ERROR:  An exception has been encountered.
Please contact technical support and provide them with the following traceback information:

The SAS task name is [DELETE]
ERROR:  Write Access Violation DELETE
Exception occurred at (242B159B)
Task Traceback
Address   Frame     (DBGHELP API Version 4.0 rev 5)
00000000242B159B  000000002E2AFBC0  sasdelet:tkvercn1+0x55B
00000000242B11FB  000000002E2AFBF0  sasdelet:tkvercn1+0x1BB
0000000003238A2B  000000002E2AFBF8  sashost:Main+0x10F0B
000000000323E66D  000000002E2AFF50  sashost:Main+0x16B4D
000000007793556D  000000002E2AFF58  kernel32:BaseThreadInitThunk+0xD
0000000077B9372D  000000002E2AFF88  ntdll:RtlUserThreadStart+0x1D

I am no expert, but it seems like a buffer overrun to me. I guess that there's a limit on how many datasets you can delete?
If so, what are the suggested alternatives for deleting datasets in bulk?

 

Thanks!

10 REPLIES 10
ballardw
Super User

"Code like" or "exactly that code"?

If the code is at all different you should include the exact code submitted.

 

Seeing a value like

74DATA175DATA176DATA177DATA1

where that initial 74 looks like it should belong to a "Data174".

You may want to examine that string in something that shows hidden characters. The Copy and Paste here may hide it but there are other characters than spaces between data176 data177. Might almost suspect a malformed macro variable ...

The error message is chopping your variable list into 32 character chunks as that is the largest data set name allowed. I have no clue where those other characters are coming from though.

gabonzo
Quartz | Level 8

It is the exact code I used to obtain the log error.

smantha
Lapis Lazuli | Level 10
%macro delete;
proc datasets lib=work nolist;
delete %do i = 1 %to 200;
            data&i.
           %end;;
run;
quit;
%mend delete;
%delete;
SASKiwi
PROC Star

Does this program produce the same error?

proc delete data=data: ;
run;
ballardw
Super User

@SASKiwi wrote:

Does this program produce the same error?

proc delete data=data: ;
run;

At least my version yields:

165  proc delete data=data: ;
                          -
                          22
                          200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, -, '.'.

ERROR 200-322: The symbol is not recognized and will be ignored.

166  run;

Though this doesn't seem to have the same problem:

proc datasets library=work;
   delete data: ;
run;
quit;
ChrisNZ
Tourmaline | Level 20

That's a bug and should be referred to Tech Support.

Even 20 tables trip it (though without access violation).


29         proc delete data=data1-data20;run;

WARNING: File WORK.DATA1.DATA does not exist.
WARNING: File WORK.DATA2.DATA does not exist.
ERROR: The value DAT   is not a valid SAS name.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
ERROR: The value ÀDATA5DATA6DATA7DATA8DATA9 is not a valid SAS name.
WARNING: File WORK.DATA18.DATA does not exist.
WARNING: File WORK.DATA19.DATA does not exist.
WARNING: File WORK.DATA20.DATA does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
WARNING: File WORK does not exist.
NOTE: The SAS System stopped processing this step because of errors.

 

 

Kurt_Bremser
Super User

In which environment do you run that?

Because this worked for me:

 72         
 73         proc delete data=data1-data20;
 74         run;
 
 WARNING: Datei WORK.DATA1.DATA existiert nicht.
 WARNING: Datei WORK.DATA2.DATA existiert nicht.
 WARNING: Datei WORK.DATA3.DATA existiert nicht.
 WARNING: Datei WORK.DATA4.DATA existiert nicht.
 WARNING: Datei WORK.DATA5.DATA existiert nicht.
 WARNING: Datei WORK.DATA6.DATA existiert nicht.
 WARNING: Datei WORK.DATA7.DATA existiert nicht.
 WARNING: Datei WORK.DATA8.DATA existiert nicht.
 WARNING: Datei WORK.DATA9.DATA existiert nicht.
 WARNING: Datei WORK.DATA10.DATA existiert nicht.
 WARNING: Datei WORK.DATA11.DATA existiert nicht.
 WARNING: Datei WORK.DATA12.DATA existiert nicht.
 WARNING: Datei WORK.DATA13.DATA existiert nicht.
 WARNING: Datei WORK.DATA14.DATA existiert nicht.
 WARNING: Datei WORK.DATA15.DATA existiert nicht.
 WARNING: Datei WORK.DATA16.DATA existiert nicht.
 WARNING: Datei WORK.DATA17.DATA existiert nicht.
 WARNING: Datei WORK.DATA18.DATA existiert nicht.
 WARNING: Datei WORK.DATA19.DATA existiert nicht.
 WARNING: Datei WORK.DATA20.DATA existiert nicht.
 NOTE:  Verwendet wurde: PROZEDUR DELETE - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.00 seconds

Both in University Edition (Linux) on a Mac and in our AIX-based server.

ChrisNZ
Tourmaline | Level 20

@Kurt_Bremser > In which environment do you run that?

9.4M2 on windows. 

 

Either my version is too old, or SAS Windows gets confused, or Der deutsche Einfluss macht einen Unterschied.

Kurt_Bremser
Super User

It would be great if someone with 9.4M6 on Windows (or 9.4Mless_than_6 on UNIX) could chime in with a test. A simple google search for "SAS hotfix proc delete" did not reveal if there was a recent fix.

gabonzo
Quartz | Level 8

My version is SAS 9.4 TS Level 1M2 platform X64_7PRO

 

Glad I am not the only one who saw it! 😉

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
  • 10 replies
  • 841 views
  • 2 likes
  • 6 in conversation