proc sql;
create table total2 as
select idnumber, jobcode, sale1, sale2, sum(sale1) as s1, sum(sale2) as s2,
sum(sale1, sale2) as s3
from sumy
group by jobcode;
quit;
Hello , is anybody can tell me about the order of observations in each group without having clause and order by clause when group by clause?
In the attachment and code, the table total is the original data, after using groupy by clause, the entire data is grouped by jobcode shown in table total2. However, I found the order of observations in each group is werid. I assume the order should be sequencial as the original data, but is wasn't.
Order by clause can modify the order in each group, if there is no order by clause, what's the order convention in each group, which is my concern.
Hope anyone can explain it for me.
Many thanks!
It's undetermined, and an effect of the order in which observations are read from the utility file when the output is written.
Always specify the order yourself if you need a specific one.
It's undetermined, and an effect of the order in which observations are read from the utility file when the output is written.
Always specify the order yourself if you need a specific one.
Thank you Kurt, now I get it.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.