SAS Certified Adv Programmer 50 Questions (3)
Which one of the following programs is syntactically correct?
a.
proc sql;
create table forecast as
select a.*, b.sales
from actual a, budget b
where a.dept=b.dept and
a.month=b.month;
quit;
b.
proc sql;
create table forecast as
select a.* b.sales
from actual as a, budget as b
where a.dept=b.dept and
a.month=b.month;
quit;
c.
proc sql;
create table forecast as
select a.*, b.sales
from actual as a, budget as b
where dept=dept and
month=month;
quit;
d.
proc sql;
create table forecast as
select a.*, b.sales
from actual, budget
where a.dept=b.dept and
a.month=b.month;
quit;
Topics:
SAS Adv Questions |
3 Comments »
A
I think the answer is B. “as” is needed for defining a table alias.
Please ignore my previous comment. The answer should be A. “as” is optional. In the choice B, the comma is missing in the “select” statement.