Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to output max value with id or obs number using PROC means?

Status
Not open for further replies.

letssas

Technical User
Mar 18, 2006
1
US
a dataset looks like this:

obs id var1 var2
1 a 12 30
2 b 14 31
...

how to output max values of var1 and var2 with id or obs numbers using PROC means?

how to do this using PROC SQL?
thanks.
 
You don't need proc means.
Code:
data outpt;
  set inpt;
  * either of these methods work *;
  maxval = max(of var1-var3);
  maxval = max(var1,var2,var3);

run;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top