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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 601 views
  • 0 likes
  • 3 in conversation