BookmarkSubscribeRSS Feed
amym
Calcite | Level 5
When I save a dataset in SAS and in SPSS, the SAS file is significantly larger than the SPSS file (e.g., 7 MB is SAS and 968 KB in SPSS).

Does anyone know why this is and if there is a way that I can decrease the file size in SAS?

Thanks!
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
Why: they store data differently.

To reduce the file size in SAS, the best way is the judicious use of the LENGTH statement. With that big a difference in files sizes, I suspect that you have some character fields that are very long.

Doc Muhlbaier
Duke
Peter_C
Rhodochrosite | Level 12
Another way to reduce the storage required for SAS tables is the compress=char option.
It won't always reduce the storage required, but for tables with a lot of white space (wide character columns that are not always filled) the saving can be substantial.

data demo_wide (compress= yes) ;
length wide1-wide20 $32760 ;
do i= 1 to 100 ;
output ;
end;
run ;
generates these messages[pre]NOTE: The data set WORK.DEMO_WIDE has 100 observations and 21 variables.
NOTE: Compressing data set WORK.DEMO_WIDE decreased size by 98.00 percent.
Compressed is 2 pages; un-compressed would require 100 pages.
NOTE: DATA statement used [/pre]Of course you won't get 98% decrease when you store data, but I suspect if SPSS can store the information in a much smaller space, then the compress option on your SAS table would reduce its demand for disk space too.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1584 views
  • 0 likes
  • 3 in conversation