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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1431 views
  • 0 likes
  • 3 in conversation