13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SAS</strong> Names and Support <strong>for</strong> DBMS Names 4 Using a <strong>SAS</strong> Data Set to Create a DBMS Table 23proc sql;create table mydblib.gt<strong>for</strong>ty asselect lname as LAST_NAME,fname as FIRST_NAME,salary as ANNUAL_SALARYfrom mydblib.staff a,mydblib.payroll bwhere (a.idnum eq b.idnum) and(salary gt 40000)order by lname;proc print noobs;title ’Employees with Salaries over $40,000’;run;Output 2.7Updating DBMS DataEmployees with Salaries over $40,000ANNUAL_LAST_NAME FIRST_NAME SALARYBANADYGA JUSTIN 88606BAREFOOT JOSEPH 43025BRADY CHRISTINE 68767BRANCACCIO JOSEPH 66517CARTER-COHEN KAREN 40260CASTON FRANKLIN 41690COHEN LEE 91376FERNANDEZ KATRINA 51081Using a <strong>SAS</strong> Data Set to Create a DBMS TableThe following example uses a <strong>SAS</strong> DATA step to create a DBMS table,College-Hires-1999, from a temporary <strong>SAS</strong> data set that has case-sensitive names. Itcreates the temporary data set and then defines the LIBNAME statement. Because ituses a DATA step to create the DBMS table, it must specify the table name as a nameliteral and specify the PRESERVE_TAB_NAMES= and PRESERVE_COL_NAMES=options (in this case, by using the alias PRESERVE_NAMES=).options validvarname=any nodate;data College_Hires_1999;input IDnum $4. +3 Lastname $11. +2Firstname $10. +2 City $15. +2State $2.;datalines;3413 Schwartz Robert New Canaan CT3523 Janssen Heike Stam<strong>for</strong>d CT3565 Gomez Luis Darien CT;libname mydblib oracle user=testuser password=testpasspath=’hrdata99’ schema=hrdept preserve_names=yes;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!