|
|||
|
I have one variable (or alternatively five binary variables) that I want touse and at the same time minimize memory usage. Either the variable is one with five statuses (and for human memory purposes single character c, p, m, o, or b) or five binary variables c=0 or 1 through b= 0 or 1.
If I use it as a character variable then when I need it later I will have to do proc summary five times proc summary data=dataset (where=(variable=c)) n; var variable; output out=output_for_c n=N_C; run; for each one and then merge. Alternatively with the five binary variables I would end up with proc summary data=dataset sum; var c p m o b; output out=output_for_all sum/autoname; run; Any suggestions to minimize memory useage? Thanks! There are 50 to 100 million observations. |
|
|
||||
|
||||
|
|
|
|||
|
Use PROC FREQ:
proc freq data=dataset noprint ; tables variable / out=output_for_all ; run ; On Friday, July 13, 2012 1:51:50 PM UTC-4, (unknown) wrote: > I have one variable (or alternatively five binary variables) that I want to use and at the same time minimize memory usage. Either the variable is one with five statuses (and for human memory purposes single character c, p, m, o, or b) or five binary variables c=0 or 1 through b= 0 or 1. > > If I use it as a character variable then when I need it later I will haveto do proc summary five times > > proc summary data=dataset (where=(variable=c)) n; > var variable; > output out=output_for_c n=N_C; > run; > > for each one and then merge. > > Alternatively with the five binary variables I would end up with > > proc summary data=dataset sum; > var c p m o b; > output out=output_for_all sum/autoname; > run; > > > Any suggestions to minimize memory useage? > > Thanks! > There are 50 to 100 million observations. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|