BookmarkSubscribeRSS Feed
ashkum
Calcite | Level 5

 

data table_b;
infile datalines;
input std_id$ physics_mark;
datalines;
s001 73
s003 65
s004 52
s006 76
;
run;

 

I have to create new table which shows that maximum marks i.e only one observation so in that case soo6 has maximum marks. how do i use proc sql to find maximum marks.

2 REPLIES 2
singhsahab
Lapis Lazuli | Level 10

Here you can go...

 

proc sql;
create table want as select * from table_b h where 0= (select count(physics_mark) from table_b h1 where h.physics_mark< h1.physics_mark);
quit;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 842 views
  • 0 likes
  • 3 in conversation