Creating an Empty Table That Is like Another Table

Overview

Sometimes you want to create a new table that has the same columns and attributes as an existing table, but has no rows. To create an empty table that is like another table, use a CREATE TABLE statement with a LIKE clause.
General form, CREATE TABLE statement with a LIKE clause:
CREATE TABLE table-name
LIKE table-1;
Here is an explanation of the syntax:
table-name
specifies the name of the table to be created.
table-1
specifies the table whose columns and attributes are copied to the new table.

Example

Suppose you want to create a new table, Work.Flightdelays2, that contains data about flight delays. You would like the new table to contain the same columns ...

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.