05-27-2017 10:01 AM - last edited on 05-27-2017 10:32 AM by Reeza
Hi guys ,
I am doing inner join using proc sql, please see the below code.
input name$ age;
input name$ marks;
select * from am,am1 where am.name=am1.name;
Question : Why age=78 is below the age=45 where as in data step age=78 is above. Request, kindly explain.
05-27-2017 10:40 AM
RTM. You didn't specify any order so you cannot expect any order to the data.
Also, I didn't run your code but that output doesn't match the code you've shown either. I'm assuming it's correct but you've truncated the output for some reason.
If an ORDER BY clause is omitted, then a particular order to the output rows, such as the order in which the rows are encountered in the queried table, cannot be guaranteed—even if an index is present. Without an ORDER BY clause, the order of the output rows is determined by the internal processing of PROC SQL, the default collating sequence of SAS, and your operating environment.