BookmarkSubscribeRSS Feed
EinarRoed
Pyrite | Level 9

Is there a way to output a list of all libraries that use the COMPRESS option?

6 REPLIES 6
Astounding
PROC Star

The COMPRESS option (and the method used) is applied on a data set by data set level.  It is not applicable at the library level.  That being said, you should be able to extract the information on each data set from dictionary.tables.

PeterClemmensen
Tourmaline | Level 20

I don't think the information exists in SAS metadata on library level. The obvious place to look would be the dictionary.libnames table, but no..

andreas_lds
Jade | Level 19

Interesting: you can set compress in the libname-statement, but the information is not in sashelp.vlibnam, but in sashelp.vtable (or dictionary.tables).

ballardw
Super User

@andreas_lds wrote:

Interesting: you can set compress in the libname-statement, but the information is not in sashelp.vlibnam, but in sashelp.vtable (or dictionary.tables).


Possibly because some data sets don't gain anything when "compressed"? You can get this message when SAS determines that attempting to compress would result in a larger file size:

NOTE: Compression was disabled for data set WORK.ONE because compression 
      overhead would increase the size of the data set.

because the compress option, which can be a System option as well as library or dataset, adds a block of data to each observation related to the compression.

 

 

Astounding
PROC Star

Remember, the same folder can switch options from one program to the next.  In one program, the libname-level option could be yes, and in another in could be no.  The individual data sets within a library can use different compression options, regardless of what appears in one particular program.

Tom
Super User Tom
Super User

@andreas_lds wrote:

Interesting: you can set compress in the libname-statement, but the information is not in sashelp.vlibnam, but in sashelp.vtable (or dictionary.tables).


There are a lot of LIBNAME settings that cannot be determined from that metadata.

 

Note that the default setting for compress that is defined for the libref can be overridden at the dataset level via the dataset option COMPRESS=. Also SAS will sometimes override the users setting completely.  If you try to add compression to a very skinny dataset then SAS will turn it off since it will just make the dataset larger.

 

So even if you could find the libref level default setitng it wouldn't really tell you anything other than what default compression MIGHT be applied to the next dataset created using that libref.

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 822 views
  • 0 likes
  • 6 in conversation