11-14-2011 04:43 AM
I should use the proc means in a particular way: n-1 values are stored in a DS (e.g. DS1) the last value is passed by a macro variable.
How can I do without writing the last value into the DS?
PROC MEANS DATA=DS1 noprint
; /*and the value stored in the macro variable &outvalue*/
OUTPUT OUT=outfile(drop=_TYPE_ _FREQ_) median
11-14-2011 07:03 AM
Try after you get those results of PROC MEANS doing the following:
* select the value of your macro variable;
call symput('outvalue', mymedian);
%Put outvalue is &outvalue;
*keep only n-1 observations to DS1 data set;
set DS1 end=last;
if last then delete;
11-14-2011 10:23 AM
Still don't get the point.
I was running your PROC MEANS with sashelp.class (class age), and then you want to delete 16-year olds. Why?
And still don't understand the use of &outvalue. Your are creating it, but not using it...?
I don't think there is an option in PROC MEANS to delete the last row.
But you could merge your two data steps:
if last then do;