Understanding Methods of Creating Tables
You can use PROC SQL to create
a table in three ways. The CREATE TABLE statement is used for all
three methods, although the syntax of the statement varies for each
method.
Method of Creating a
Table
|
Example
|
---|---|
create an empty table
by defining columns
|
proc sql;
create table work.discount
(Destination char(3),
BeginDate num Format=date9.,
EndDate num format=date9.,
Discount num); |
create an empty table
that is like (has the same columns and attributes as) an existing
table
|
proc sql; create table work.flightdelays2 like sasuser.flightdelays; |
create a populated table
(a table with both columns and rows of data) from a query result
|
proc sql; create table work.ticketagents as select ... |
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.