Accessing DBMS Data with the LIBNAME Statement Creating a DBMS Table 253
Output 13.12 Deleting DBMS Data
AIRLINE.STAFF After Deleting Connecticut Employees 1
OBS IDNUM LNAME FNAME CITY STATE HPHONE
1 1400 ALHERTANI ABDULLAH NEW YORK NY 212/586-0808
2 1350 ALVAREZ MERCEDES NEW YORK NY 718/383-1549
3 1401 ALVAREZ CARLOS PATERSON NJ 201/732-8787
4 1499 BAREFOOT JOSEPH PRINCETON NJ 201/812-5665
5 1101 BAUCOM WALTER NEW YORK NY 212/586-8060
6 1402 BLALOCK RALPH NEW YORK NY 718/384-2849
7 1479 BALLETTI MARIE NEW YORK NY 718/384-8816
8 1739 BRANCACCIO JOSEPH NEW YORK NY 212/587-1247
9 1658 BREUHAUS JEREMY NEW YORK NY 212/587-3622
10 1244 BUCCI ANTHONY NEW YORK NY 718/383-3334
11 1383 BURNETTE THOMAS NEW YORK NY 718/384-3569
12 1574 CAHILL MARSHALL NEW YORK NY 718/383-2338
13 1789 CARAWAY DAVIS NEW YORK NY 212/587-9000
14 1404 COHEN LEE NEW YORK NY 718/384-2946
15 1065 COPAS FREDERICO NEW YORK NY 718/384-5618
16 1876 CHIN JACK NEW YORK NY 212/588-5634
17 1129 COUNIHAN BRENDA NEW YORK NY 718/383-2313
18 1988 COOPER ANTHONY NEW YORK NY 212/587-1228
19 1405 DACKO JASON PATERSON NJ 201/732-2323
20 1983 DEAN SHARON NEW YORK NY 718/384-1647
Creating a DBMS Table
You can create new tables in your DBMS by using the SQL procedure. This example
uses the SQL procedure to create the Oracle table GTForty by using data from the
Oracle Staff and Payroll tables.
libname mydblib oracle user=testuser password=testpass;
proc sql;
create table mydblib.gtforty as
select lname as lastname,
fname as firstname,
salary as Salary
format=dollar10.2
from mydblib.staff a,
mydblib.payroll b
where (a.idnum eq b.idnum) and
(salary gt 40000);
quit;
options obs=20;
proc print data=mydblib.gtforty noobs;
title ’Employees with salaries over $40,000’;
format salary dollar10.2;
run;
Partial output for this example is shown here.