Table Creation Techniques

Create a Table with the DATA Step

In this DATA step example, you create a new table named SPDS.OLD_AUTOS on the server.
libname spds sasspds 'conversion_area' server=husky.spdsname
user='siteusr1' prompt=yes;

data spds.old_autos;
input year $4. @6 manufacturer $12. model $12. body_style $5.
engine_liters @39 transmission_type $1. @41 exterior_color
$10. options $10. mileage conditon;
datalines;
1966 Ford Mustang conv 3.5 M white 00000001 143000 2
1967 Chevrolet Corvair sedan 2.2 M burgundy 00000001 70000 3
1975 Volkswagen Beetle 2door 1.8 M yellow 00000010 80000 4
1987 BMW 325is 2door 2.5 A black 11000010 110000 3
1962 Nash Metropolitan conv 1.3 M red 00000111 125000 3
;

Create a Table with PROC SQL

In this PROC SQL example, you create a new table named SPDS.LOTTERYWIN on the server. The LIBNAME statement includes the option IP=YES to invoke implicit SQL pass-through.
libname spds sasspds 'conversion_area'
server=husky.spdsname
user='siteusr1'
prompt=yes
ip=yes;

proc sql;
create table spds.lotterywin (ticketno num, winname char(30));
insert into spds.lotterywin values (1, 'Wishu Weremee');
quit;
Last updated: February 8, 2017