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 .
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.
hello same has been edited !!
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.
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
1281 | 114832053 |
which is not the required result i want maximum of AON for all product id's
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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.