LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 29 Aug 2006 16:34:59 -0400
Reply-To:   Jerry <greenmt@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jerry <greenmt@GMAIL.COM>
Subject:   alternative ways to get Min and Max?

Hi,

I use PROC MEANS to get Min and Max of the value of a numerical variable, see codes below.

Data minmax; input num; datalines; 1 2 3 ; run;

Proc means data=minmax noprint; var num; output out=range max=last min=first; run;

Then I use CALL SYMPUTX to assign the min & max value to 2 macro variables, see codes below,

Data _null_; set range; if _n_=1 then do; call symputx ("start", first); call symputx ("end", last); stop; end; run;

Is there any other way (excluding Proc Sql) to skip Proc Means while achieving the same goal: assign the min & max value to 2 macro variables ?

Thanks,

Jerry


Back to: Top of message | Previous page | Main SAS-L page