BookmarkSubscribeRSS Feed
Shrutibhatnagar
Obsidian | Level 7

Hello 

i have smb1 dataset which has 3 different AGE OF NETWORKS for 3 different years 

i want to select only the MAXIMUM AON  using proc sql and also use this maximum AGE OF NETWORKS against the Product id 

as 3  different AGES are not possible .  how to create the data set for  age of network along one id .

 

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Please show us a representative portion of the data that you are working on. Please show us the output you desire from the representative portion of your data.

 

Please go back and edit the title to something a little more descriptive of the problem.

 

 

--
Paige Miller
Shrutibhatnagar
Obsidian | Level 7

hello same has been edited !!

Kurt_Bremser
Super User

You added a spreadsheet, not a dataset. The proper method for posting SAS datasets is data steps with datalines.

A re-import of a spreadsheet is close to 100% sure to be different from the original dataset.

Shrutibhatnagar
Obsidian | Level 7

proc sql;
select distinct Max(AON ) AS Maximum_of_AON,smb.product_id
from class1.smb as Actual_AON
group by product_id
having AON=max(AON);
quit;

 

which gives :

Maximum_of_AON PRODUCT_ID

1281114832053

 

which is not the required result i want maximum of AON for all product id's 

PGStats
Opal | Level 21

You seem to need:

 

proc sql;
select 
    AON AS Maximum_of_AON,
    product_id
from class1.smb
group by product_id
having AON=max(AON);
quit;
PG

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 662 views
  • 0 likes
  • 4 in conversation