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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 2836 views
  • 0 likes
  • 3 in conversation