The INSERT Statement
A Brief Overview
You can use the INSERT statement
in three ways to insert rows of data into existing, empty, or populated
tables.
Method of Inserting
Row
|
Example
|
---|---|
insert values by column
name by using the SET clause
|
proc sql; insert into work.discount set destination='LHR', begindate='01MAR2018'd, enddate='05MAR2018'd, discount=.33 set destination='CPH', begindate='03MAR2018'd, enddate='10MAR2018'd, discount=.15; quit; |
insert lists of values
by using the VALUES clause
|
proc sql; insert into work.discount (destination, begindate,enddate,discount) values ('LHR','01MAR2018'd, '05MAR2018'd,.33) values ('CPH','03MAR2018'd, '10MAR2018'd,.15); quit; |
insert rows that are copied from another table by ... |
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.