BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

Hi all,

 

Today, when playing with PROC IMPORT, I have a look on the log and see that SAS automatically compress my files, I check again and see that I did not put the

options compress=yes reuse=yes;

The code is as below

proc import datafile= "E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_xlsx" 
                  out= exc_rate
                  dbms= xlsx 
                  replace;
          range= "Sheet1$A:BC";
          getnames= yes;
run;

proc contents data=exc_rate out=abc;
run;

And the log is as below

28         proc import datafile= "E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_xlsx"
29                           out= exc_rate
30                           dbms= xlsx
31                           replace;
32                   range= "Sheet1$A:BC";
33                   getnames= yes;
34         run;

NOTE: The import data set has 5784 observations and 55 variables.
NOTE: Compressing data set WORK.EXC_RATE decreased size by 5.00 percent. 
      Compressed is 38 pages; un-compressed would require 40 pages.
NOTE: WORK.EXC_RATE data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           2.72 seconds
      cpu time            2.64 seconds

So, compressing a file when using the PROC IMPORT is a function in SAS automatically?

 

Warm regards.

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Yes you have a global compress turned on.

 

From my system, to check just the Compress option

78   proc options option=compress;
79   run;

    SAS (r) Proprietary Software Release 9.4  TS1M4

 COMPRESS=NO       Specifies the type of compression to use for observations in output SAS data
                   sets.

So by default my data sets are not compressed.

 

 

 

 

View solution in original post

5 REPLIES 5
andreas_lds
Jade | Level 19

So, compressing a file when using the PROC IMPORT is a function in SAS automatically?

No, it is not. But a library can be assigned with compress-option, so that all datasets created in that library inherit the compress option.

ChrisNZ
Tourmaline | Level 20

Also, the option might be set globally, in the config or the autoexec files.

You can run proc options to see the setting.

Phil_NZ
Barite | Level 11

Hi @ChrisNZ 

Thank you for leading me to another PROC.

I follow this link to learn about PROC OPTIONS. 

From this document, they said PROC OPTIONS:


Lists the current settings of SAS system options in the SAS log

So, it means that this PROC list all the options I have already set in my SAS EG, am I correct? or all the SAS OPTIONS available that I can set?

So, when I run the code

proc options DEFINE;

The log is really long, I search the keyword COMPRESS and I saw this one

   Group= COMMUNICATIONS
    Group Description: Remote communications and shared settings
    Description: Specifies the communication access method for connecting client and server sessions across a network.
    Type: The option value is of type CHARACTER
          Maximum Number of Characters: 8
          Casing: The option value is retained uppercased
          Quotes: If present during "set", start and end quotes are removed
          Parentheses: The option value does not require enclosure within parentheses. If present, the parentheses are retained.
          Expansion: Environment variables, within the option value, are not expanded
    When Can Set: Startup or anytime during the SAS Session
    Restricted: Your Site Administrator can restrict modification of this option
    Optsave: PROC Optsave or command Dmoptsave will save this option
 COMPRESS=YES
Option Definition Information for SAS Option COMPRESS

Does it mean that I already set OPTIONS COMPRESS globally in my SAS EG?

Cheers.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
ballardw
Super User

Yes you have a global compress turned on.

 

From my system, to check just the Compress option

78   proc options option=compress;
79   run;

    SAS (r) Proprietary Software Release 9.4  TS1M4

 COMPRESS=NO       Specifies the type of compression to use for observations in output SAS data
                   sets.

So by default my data sets are not compressed.

 

 

 

 

ChrisNZ
Tourmaline | Level 20

Note that SAS jobs are most often constrained by disk speed, so compressing data sets is typically a good idea: it reduces disk usage (but increases CPU usage).

As usual, cases vary, and for the particular example your showed, a space saving of 5% is probably not worth the CPU cost.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 2466 views
  • 4 likes
  • 4 in conversation