0

I am writing this basic sql statement in proc sql yet SAS throws me an error.

    proc sql;
select interest from
(select * from project.data_model
order by ethnicity desc, satscore desc);
quit;

ERROR 79-322: Expecting a ).

ERROR 22-322: Syntax error, expecting one of the following: ;, ','.

ERROR 200-322: The symbol is not recognized and will be ignored

I know I can write interest in the inner query itself but I was just giving a try using inline query.

Please help.

newbie49
  • 1
  • 2

1 Answers1

0

The error message you receive is not very helpful. The problem you have is that order by is not valid within an in-line view, which is effectively what your subquery is creating. To solve this you need to put the order by statement outside of the subquery.

proc sql;
select interest from
(select * from project.data_model)
order by ethnicity desc, satscore desc;
quit;
Longfish
  • 7,582
  • 13
  • 19