I tried to ORDER a table while creating it, but then noticed that SAS does not allow it . Here is the code
proc sql;
create table test as (
select *
from sashelp.class
order by name);
quit;
Here are the errors that I get :
1383 order by name);
-----
79
ERROR 79-322: Expecting a ).
1383! order by name);
-
79
ERROR 79-322: Expecting a (.
I can certainly use proc sort but I read the CREATE TABLE documentation and did not find any restrictions placed on ORDER BY other than it is not recommended . SAS documentation lists the create . . order by as a valid syntax . So what is the problem here ?
By The Way . . simple select . . order by works fine
proc sql;
select *
from sashelp.class
order by name;
quit;*
Remove the parentheses:
proc sql;
create table test as
select *
from sashelp.class
order by name;
quit;
Not sure why SAS doesn't like them - I think it's because they are for subqueries only, which technically this isn't. At any rate you do not need them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With