SlideShare a Scribd company logo
SAS Techies [email_address] http://www.sastechies.com
Reading and Writing data to Other DBMS’s SAS Access Libname Method SAS Connect Pass Thru SQL ( RSPT ) Proc Dbload / Proc Access Which one to Choose and when ?? 11/13/09 SAS Techies 2009
The LIBNAME statement enables you to assign SAS librefs to DBMS objects such as schemas and databases. After a database is associated with a libref, you can use a SAS two-level name to specify any table or view in the database and then work with the table or view as you would with a SAS data set.  SAS Techies 2009 LIBNAME  libref  oracle  <connection-options> <LIBNAME-options>;  DBCOMMIT=n  PRESERVE_COL_NAMES= NO | YES  PRESERVE_TAB_NAMES= NO | YES
libname orcl oracle user=scott password=tiger path=&quot;ORCL&quot;; Options  sastrace=‘,,,d’; data  orcl.admit; input x y; cards; 1 2 3 4 5 6 ; run ; data  orcl.ap; set perm.airports; run ; Proc sql; Create table orcl.ap as Select * from perm.airports; Quit; Proc   sql ; Create table orcl.ap1 as Select * from perm.admitjune A, perm.admit B Where A.id=B.id; Quit; libname orcl db2 user=scott password=tiger path=“DB2&quot;; Proc sql; Create table orcl.ap1 as Select * from orcl.ap A, db2.ap B Where A.id=B.id; Quit; 11/13/09 SAS Techies 2009
The Pass-Through Facility enables you to interact with a data source using its native SQL syntax without leaving your SAS session. The SQL statements are passed directly to the data source for processing.  SAS Techies 2009
Creating SAS dataset from DBMS table proc   sql ; connect to oracle (user=scott password=tiger path=&quot;ORCL&quot;); create table work.cool as select * from connection to oracle (select A.* from info A, descr B where A.FlightID=B.FlightID ); disconnect from oracle; quit; Creating a DBMS table from two  DBMS tables proc   sql ; connect to oracle (user=scott password=tiger path=&quot;ORCL&quot;); execute( create table Sharad as  select A.* from info A, descr B where A.FlightID=B.FlightID ) by oracle; execute( COMMIT ) by oracle; disconnect from oracle; quit; 11/13/09 SAS Techies 2009
proc   dbload  dbms=oracle  data=perm.admit;  *SAS dataset; user=scott;  password=tiger;  path='ORCL';  table=newemp;  *DBMS Table; commit= 100 ;  errlimit= 10 ;  load;  run ; The ACCESS and DBLOAD procedures support indirect access to DBMS data. These procedures are no longer the recommended method for accessing DBMS data, but they continue to be supported for the database systems and environments on which they were available for SAS Version 6.  SAS Techies 2009
11/13/09 SAS Techies 2009
11/13/09 SAS Techies 2009
Usually the fastest and most direct method.. An exception to this is when you need to use non-ANSI standard SQL. Only way to Join data on Two different DBMS. Significantly fewer lines of SAS code. You do not need to know the SQL language of your DBMS. The LIBNAME statement provides more control over DBMS operations such as locking, spooling, and data type conversion through the use of LIBNAME and data set options.  The engine can optimize the processing of joins and WHERE clauses by passing these operations directly to the DBMS. The engine can pass some functions directly to the DBMS for processing.  Pass-Through Facility statements enable the DBMS to optimize queries, particularly when you join tables.  The DBMS optimizer can take advantage of indexes on DBMS columns to process a query more quickly and efficiently. Pass-Through Facility statements enable the DBMS to optimize queries when the queries have summary functions. Pass-Through Facility statements give you better access to DBMS return codes. The Pass-Through Facility accepts all the extensions to ANSI SQL that are provided by your DBMS  11/13/09 SAS Techies 2009

More Related Content

PPTX
Proc SQL in SAS Enterprise Guide 4.3
PPT
SAS Macros
PPT
Utility Procedures in SAS
PPT
SAS Functions
PPT
Basics Of SAS Programming Language
PDF
SAS cheat sheet
PPT
Data Match Merging in SAS
PPT
SAS Macros part 1
Proc SQL in SAS Enterprise Guide 4.3
SAS Macros
Utility Procedures in SAS
SAS Functions
Basics Of SAS Programming Language
SAS cheat sheet
Data Match Merging in SAS
SAS Macros part 1

What's hot (20)

DOCX
SAS Programming Notes
PPT
Base SAS Statistics Procedures
PDF
Sas cheat
PPT
Understanding SAS Data Step Processing
PPTX
sas project work
PPTX
SQL - DML and DDL Commands
PDF
Introduction To Sas
PPT
SAS Macros part 2
PDF
MySQL Overview
PPT
INTRODUCTION TO SAS
PPTX
Sas Functions INDEX / INDEXC / INDEXW
PDF
Sas summary guide
PDF
Proc report
DOC
Sql queires
PDF
DHA -RN Resume
PPTX
SAS basics Step by step learning
PDF
Introduction to SAS Data Set Options
PDF
Introduction to sas
SAS Programming Notes
Base SAS Statistics Procedures
Sas cheat
Understanding SAS Data Step Processing
sas project work
SQL - DML and DDL Commands
Introduction To Sas
SAS Macros part 2
MySQL Overview
INTRODUCTION TO SAS
Sas Functions INDEX / INDEXC / INDEXW
Sas summary guide
Proc report
Sql queires
DHA -RN Resume
SAS basics Step by step learning
Introduction to SAS Data Set Options
Introduction to sas
Ad

Viewers also liked (14)

PPT
SAS Proc SQL
PPT
Reading Fixed And Varying Data
PPT
SAS ODS HTML
PPT
Arrays in SAS
PPT
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
PPT
Sas Enterprise Guide A Revolutionary Tool
PPT
Hechsp 001 Chapter 3
PPT
Improving Effeciency with Options in SAS
PPT
Sas Plots Graphs
PPTX
Regression analysis
PDF
Regression Analysis
PPT
Regression analysis
PPT
Statistics
PPT
Regression analysis ppt
SAS Proc SQL
Reading Fixed And Varying Data
SAS ODS HTML
Arrays in SAS
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
Sas Enterprise Guide A Revolutionary Tool
Hechsp 001 Chapter 3
Improving Effeciency with Options in SAS
Sas Plots Graphs
Regression analysis
Regression Analysis
Regression analysis
Statistics
Regression analysis ppt
Ad

Similar to SAS Access / SAS Connect (20)

PPT
Sql Pass Through
PPT
SQL Pass Through and the ODBC Interface
PPT
Mysql
PDF
10863-2016
PDF
LECTURE NOTES.pdf
PDF
LECTURE NOTES.pdf
DOC
Oracle notes
PPT
OWB11gR2 - Extending ETL
PDF
SQL-Server Database.pdf
PPTX
PPT temp.pptx
PPTX
Designer's Favorite New Features in SQLServer
PPT
Sql Summit Clr, Service Broker And Xml
PDF
Oracle NoSQL Database release 3.0 overview
PDF
The Power of Relationships in Your Big Data
PPT
Save Coding Time with Proc SQL.ppt
DOCX
SAS Online Training Institute in Hyderabad - C-Point
PPTX
A Designer's Favourite Security and Privacy Features in SQL Server and Azure ...
ODP
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Services
PPTX
introduction to SQL query language beginner.ppt
Sql Pass Through
SQL Pass Through and the ODBC Interface
Mysql
10863-2016
LECTURE NOTES.pdf
LECTURE NOTES.pdf
Oracle notes
OWB11gR2 - Extending ETL
SQL-Server Database.pdf
PPT temp.pptx
Designer's Favorite New Features in SQLServer
Sql Summit Clr, Service Broker And Xml
Oracle NoSQL Database release 3.0 overview
The Power of Relationships in Your Big Data
Save Coding Time with Proc SQL.ppt
SAS Online Training Institute in Hyderabad - C-Point
A Designer's Favourite Security and Privacy Features in SQL Server and Azure ...
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Services
introduction to SQL query language beginner.ppt

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
MIND Revenue Release Quarter 2 2025 Press Release
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing

SAS Access / SAS Connect

  • 1. SAS Techies [email_address] http://www.sastechies.com
  • 2. Reading and Writing data to Other DBMS’s SAS Access Libname Method SAS Connect Pass Thru SQL ( RSPT ) Proc Dbload / Proc Access Which one to Choose and when ?? 11/13/09 SAS Techies 2009
  • 3. The LIBNAME statement enables you to assign SAS librefs to DBMS objects such as schemas and databases. After a database is associated with a libref, you can use a SAS two-level name to specify any table or view in the database and then work with the table or view as you would with a SAS data set. SAS Techies 2009 LIBNAME libref oracle <connection-options> <LIBNAME-options>; DBCOMMIT=n PRESERVE_COL_NAMES= NO | YES PRESERVE_TAB_NAMES= NO | YES
  • 4. libname orcl oracle user=scott password=tiger path=&quot;ORCL&quot;; Options sastrace=‘,,,d’; data orcl.admit; input x y; cards; 1 2 3 4 5 6 ; run ; data orcl.ap; set perm.airports; run ; Proc sql; Create table orcl.ap as Select * from perm.airports; Quit; Proc sql ; Create table orcl.ap1 as Select * from perm.admitjune A, perm.admit B Where A.id=B.id; Quit; libname orcl db2 user=scott password=tiger path=“DB2&quot;; Proc sql; Create table orcl.ap1 as Select * from orcl.ap A, db2.ap B Where A.id=B.id; Quit; 11/13/09 SAS Techies 2009
  • 5. The Pass-Through Facility enables you to interact with a data source using its native SQL syntax without leaving your SAS session. The SQL statements are passed directly to the data source for processing. SAS Techies 2009
  • 6. Creating SAS dataset from DBMS table proc sql ; connect to oracle (user=scott password=tiger path=&quot;ORCL&quot;); create table work.cool as select * from connection to oracle (select A.* from info A, descr B where A.FlightID=B.FlightID ); disconnect from oracle; quit; Creating a DBMS table from two DBMS tables proc sql ; connect to oracle (user=scott password=tiger path=&quot;ORCL&quot;); execute( create table Sharad as select A.* from info A, descr B where A.FlightID=B.FlightID ) by oracle; execute( COMMIT ) by oracle; disconnect from oracle; quit; 11/13/09 SAS Techies 2009
  • 7. proc dbload dbms=oracle data=perm.admit; *SAS dataset; user=scott; password=tiger; path='ORCL'; table=newemp; *DBMS Table; commit= 100 ; errlimit= 10 ; load; run ; The ACCESS and DBLOAD procedures support indirect access to DBMS data. These procedures are no longer the recommended method for accessing DBMS data, but they continue to be supported for the database systems and environments on which they were available for SAS Version 6. SAS Techies 2009
  • 10. Usually the fastest and most direct method.. An exception to this is when you need to use non-ANSI standard SQL. Only way to Join data on Two different DBMS. Significantly fewer lines of SAS code. You do not need to know the SQL language of your DBMS. The LIBNAME statement provides more control over DBMS operations such as locking, spooling, and data type conversion through the use of LIBNAME and data set options. The engine can optimize the processing of joins and WHERE clauses by passing these operations directly to the DBMS. The engine can pass some functions directly to the DBMS for processing. Pass-Through Facility statements enable the DBMS to optimize queries, particularly when you join tables. The DBMS optimizer can take advantage of indexes on DBMS columns to process a query more quickly and efficiently. Pass-Through Facility statements enable the DBMS to optimize queries when the queries have summary functions. Pass-Through Facility statements give you better access to DBMS return codes. The Pass-Through Facility accepts all the extensions to ANSI SQL that are provided by your DBMS 11/13/09 SAS Techies 2009

Editor's Notes

  • #2: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #3: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #4: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #5: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #6: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #7: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #8: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #9: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #10: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005
  • #11: SASTechies.com Sharad C Narnindi - Attic Technologies,Inc 2005