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.
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.
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.
Also, the option might be set globally, in the config or the autoexec files.
You can run proc options to see the setting.
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.
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.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.