The "order" of a merge shouldn't matter unless you're filtering.
Why do you think it matters? Does doing it different ways give you different results?
The fastest way to answer some of these types of questions is to try them both and see what works.
@nhev wrote:
Sorry the second question just meant use the average you just calculate and another average from another question and merge them together using 2 different variables roads and cara and also the method they used to apply debt consolidation and the question asking you to decide which average to merge first
Hello, @nhev, you have been asked to clarify and provide more detailed information. We really can't move forward without this information.
SQL does not have a KEEP statement or clause, but you can use the KEEP= dataset option on incoming and outgoing datasets.
In most cases, this is not needed, as you define the variables to be kept/created in the SELECT clause/statement.
@nhev wrote:
What about RENAME in sql?
Same as KEEP.
@nhev wrote:
@Paige do you know by any chance how to use KEEP statement in SQL?
So far, one other person and myself have asked you to explain the problem in more detail. You are just going to ignore this request; and this is not a good way to get help on your problem. The people in this forum provide excellent help, but we can't help if you don't explain further.
Also, when the original problem talks about PROC SUMMARY and then you switch to SQL without providing a reason, then we are further confused. Again, confusing us is not a good way to get help.
@nhev wrote:
How can I calculate the average in a proc sql using group by statement?
Simple:
proc sql;
create table want as
select
sex,
avg(age) as avg_age
from sashelp.class
group by sex
;
quit;
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!
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.