The CREATE TABLE Statement

A Brief Overview

PROC SQL offers you three ways to create a table. The CREATE TABLE statement is used for all three methods, although the statement syntax 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);
quit;
create an empty table that is like (has the same columns and attributes as) an existing table
proc sql;
   create table work.flightdelays2
      like certadv.flightdelays;
quit;
create a populated table (a table with both columns and rows of data) from a query result
proc sql;
   create table work.ticketagents ...

Get SAS Certified Professional Prep Guide 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.