BookmarkSubscribeRSS Feed
arpit
Calcite | Level 5
how to delete a sas library permanently
15 REPLIES 15
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A straightforward SAS support SEARCH request (or Google advanced) reveals several relevant references.

Scott Barry
SBBWorks, Inc.

Google advanced search argument, this topic / post:
delete sas library site:sas.com
arpit
Calcite | Level 5
Thanks for your kind information .But I go through google i couldn't find this.

So please help me on this topic .

How we can delete a sas dataset permanently.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Arpit,

Highlight a dataset name in a SAS library and press Delete or do the same thing in Windows folder (;-)

Sincerely,
SPR
polingjw
Quartz | Level 8
If you want to delete all the members in a sas library, use
[pre]
proc datasets lib= kill;
[/pre]
arpit
Calcite | Level 5
Dear Poligjw,

It delete only content of library .

I want to know how to delete complit library

Thanks for your kind information.
Peter_C
Rhodochrosite | Level 12
have you tried
LIBNAME lib ;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The technical method / process will depend on your SAS OS environment.

So, for Windows, consider using PROC DATASETS with KILL to clear the SAS library of all members followed by using the FDELETE function (either in a DATA step or with SYSFUNC using SAS macro language) to remove/delete an empty directory (or external file reference).

Scott Barry
SBBWorks, Inc.
arpit
Calcite | Level 5
Dear Sbb,

Thanks for your information Could you explain .

Regards,
Arpit
arpit
Calcite | Level 5
Yes i try with this statement but it delete the file of library
Peter_C
Rhodochrosite | Level 12
sorry, I thought that was what you wanted..
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest the OP read the available SAS DOC and also consider the SAS support http://support.sas.com/ website resources -- consider the recommended search arguments provided in a prior post-reply.

Scott Barry
SBBWorks, Inc.
Doc_Duke
Rhodochrosite | Level 12
'permanently' is subject to multiple interpretations. The search items that Scott provided can generally be used to delete a library 'reference' in a SAS programming environment.

In Unix and Windows, a library refers to a physical directory on disk. To "permanently" remove the directory and it's data requires a third party utility. For instance, "File Shredder" ( http://www.fileshredder.org/ ) will over-write the bits in Windows.

Doc Muhlbaier
Duke
MKhandelwal
Fluorite | Level 6
Hi Arpit,

You can delete a library which you have created using Libname statement.
The command is libname clear;
You can't delete SAS peramanent libraries like sasuser, sashelp, maps.

I hope this is what you want.

Regards,
Manoj Khandelwal
sas247
Calcite | Level 5

Yes, that's correct .You can use 

libname mylib clear;

 

mylib- is the library you like to delete.

the entire library with its contents will be deleted.

It is one of the house keeping practices .

 

🙂

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 15 replies
  • 17558 views
  • 3 likes
  • 9 in conversation