Help using Base SAS procedures

File size as compared to SPSS

Reply
N/A
Posts: 1

File size as compared to SPSS

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!
Trusted Advisor
Posts: 2,113

Re: File size as compared to SPSS

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
Valued Guide
Posts: 2,175

Re: File size as compared to SPSS

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.
Ask a Question
Discussion stats
  • 2 replies
  • 313 views
  • 0 likes
  • 3 in conversation