General form, CREATE
TABLE statement with query clauses:
CREATE TABLE table-name AS
SELECT column-1<,
... column-n>
FROM table-1
| view-1<,
... table-n | view-n>
<optional
query clauses>;
table-name
specifies the name
of the table to be created.
SELECT
specifies the column(s)
that appear in the table.
FROM
specifies the table(s)
or view(s) to be queried.
optional query clauses
are used to refine
the query further and include WHERE, GROUP BY, HAVING, and ORDER BY.
|
proc sql; create table work.ticketagents as select lastname, firstname, jobcode, salary from sasuser.payrollmaster, sasuser.staffmaster where payrollmaster.empid = staffmaster.empid and jobcode contains 'TA';.
select * from work.ticketagents;