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 (April 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 27 Apr 2009 16:56:21 -0400
Reply-To:     Akshaya <akshaya.nathilvar@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Akshaya <akshaya.nathilvar@GMAIL.COM>
Subject:      Re: To get lowest value among each observation
Comments: To: Sclavid Raj <sskonda@aol.com>
In-Reply-To:  <200904272015.n3RFi994003526@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1

Use an array: array vv var:; do over vv; if vv=min(of var:) then low_var=vname(vv); end;

On Mon, Apr 27, 2009 at 4:15 PM, Sclavid Raj <sskonda@aol.com> wrote:

> Hello all, > > I have four variables and 2000 obs. I need to get the lowest value in each > observation (row) among four variables in a separate variables for lowest > value, as well as that variable name. > > Here is the example: > > var1 var2 var3 var4 > 20 30 15 40 > 17 50 25 30 > . . > . . > . . > > Output should be like this; > var1 var2 var3 var4 low low_var > 20 30 15 40 15 var3 > 17 50 25 30 17 var1 > . . > . . > . . > > I think i am clear. > > Thanks in advacne. > > Sclavid. >

-- AkshayA!


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