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 (June 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Jun 2006 23:48:44 -0700
Reply-To:     "puneetgupta13@gmail.com" <puneetgupta13@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "puneetgupta13@gmail.com" <puneetgupta13@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Help - Displaying the max vaule from SAS data set
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

Hi, I am a beginner and just started using SAS 9.1 two weeks ago. I have SAS data set which contains numeric variables and now I want to display the max value in that data set corresponding to some particular variable. I thought I will go this way: 1) First I will sort the data set in increasing order by using PROC SORT by that particular variable. So the max value will be at the end of that data set.

2) Then I will display it by using

PROC PRINT DATA = XYZ; VAR <variable>; RUN;

But I do not know how to display that last observation in the SAS data set. Initially I tried to use the MAX function but did not get success coz SAS reads data at row level (If I m not wrong).

So kindly help me out. Any kind of help would be appreciated for the same. Thanks in advance

Regards, Puneet


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