Tips for Mastering Relational Databases Using SAS/ACCESS®

Slides:



Advertisements
Similar presentations
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Advertisements

1 Appendix A: Writing and Submitting SAS ® Programs A.1 Writing and Submitting SAS Programs.
UIC Data Conversion and Submission via CDX Node Client UIC Database V2 6/16/
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
DireXions – Connectivity Inside & Out File I/O Updates, ODBC 64-bit, & SQL Command Utility Presenter: Devon Austen.
Week 2 - Installation SQL SERVER2000 ENTERPRISE EDITION INSTALLATION.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Overview What is SQL Server? Creating databases Administration Security Backup.
Introduction to JDBC (Java Database Connectivity).
Copyright © 2007, SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
Java Database Connectivity (JDBC) Introduction to JDBC JDBC is a simple API for connecting from Java applications to multiple databases. Lets you smoothly.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Converting COBOL Data to SQL Data: GDT-ETL Part 1.
Configuring Identity Manager 2 (formerly DirXML ® ) for JDBC (w/DirXML) Jason Elsberry Software Engineer
Tom Castiglia Hershey Technologies
Copyright © 2002, SAS Institute Inc. All rights reserved. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries.
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Oracle Data Integrator Procedures, Advanced Workflows.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Copyright © 2005, SAS Institute Inc. All rights reserved. Effective Use of SAS/GRAPH® Stored Processes Pat Berryman Senior Software Manager Data Visualization.
Improving Database Performance Derrick Rapley
Macro Variable Resolution Enio Presutto York University, Toronto, Canada.
What is a Package? A package is an Oracle object, which holds other objects within it. Objects commonly held within a package are procedures, functions,
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
PowerBuilder Online Courses - by Prasad Bodepudi Database Painter Primary & Foreign Keys Extended Attributes PowerBuilder System Tables Database Profiles.
Central Arizona Phoenix LTER Center for Environmental Studies Arizona State University Data Query Peter McCartney RDIFS Training Workshop Sevilleta LTER.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
9 Copyright © 2009, Oracle. All rights reserved. Deploying and Reporting on ETL Jobs.
Basics of JDBC Session 14.
1 Do You Need an ETL Tool? Ben Bor NZ Ministry of Health Ben Bor NZ Ministry of Health.
ViaSQL Technical Overview. Viaserv, Inc. 2 ViaSQL Support for S/390 n Originally a VSE product n OS/390 version released in 1999 n Identical features.
Stored Procedures / Session 4/ 1 of 41 Session 4 Module 7: Introducing stored procedures Module 8: More about stored procedures.
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
ViaSQL Transfer. Viaserv, Inc. Transfer – 2 The ViaSQL Transfer n Available only with ViaSQL Integrator n Move data between OS/390 and a LAN database.
SAS/ACCESS Performance Initiatives PDXSUG 2010 Howard Plemmons Senior Software Manager SAS Copyright © 2010 SAS Institute.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
Copyright © SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
Slide 1 © 2016, Lera Technologies. All Rights Reserved. Oracle Data Integrator By Lera Technologies.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
© 2016 Autodesk What’s New in Autodesk ® AutoCAD Electrical 2017 Gaurav Sachdeva Product Manager.
19 Copyright © 2008, Oracle. All rights reserved. Security.
ASP.NET Programming with C# and SQL Server First Edition
DEPTT. OF COMP. SC & APPLICATIONS
Chapter 10: Accessing Relational Databases (Self-Study)
Effective T-SQL Solutions
Advantages of sas for reporting
JDBC Database Management Database connectivity
Stored Procedures.
© 2016, Mike Murach & Associates, Inc.
Bridging the Data Science and SQL Divide for Practitioners
A brief introduction to the topic
LOCO Extract – Transform - Load
The Client/Server Database Environment
ISC440: Web Programming 2 Server-side Scripting PHP 3
Server & Tools Business
Data Upload & Management
Lisa Mendez, PhD & Andrew Kuligowski
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Automate Repetitive Programming Tasks: Effective SAS® Code Generators
Efficient Use of Disk Space in SAS® Application Programs
Presentation transcript:

Tips for Mastering Relational Databases Using SAS/ACCESS® Copyright © 2010, SAS Institute Inc. All rights reserved. Andrew Clapson MD Financial Management (Ottawa, ON, Canada) SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies.

Tips for Mastering Relational Databases Using SAS/ACCESS® #1 – Set up and to configure your ODBC connections What does this mean? SAS/ACCESS interface to ODBC uses the ODBC (Open Database Connectivity) API to communicate with other databases Why is this useful? In order for SAS to ‘talk’ to a particular database using ODBC, a DSN (data source name) is required You can tweak the settings for each server/database depending on your requirements How does this work? Example (using Windows 7): ODBC Data Source Administrator User vs. System DSN Add -> Driver -> Setup (server name, database, etc.)

Tips for Mastering Relational Databases Using SAS/ACCESS® #2 – Use PROC SQL return codes/messages from database operations What does this mean? Every database has its own set of return codes and logging messages, and SAS provides automatic macro variables to use these values in your programs. Why is this useful? Default error codes correspond only to the code executed by SAS – if we include information from the database itself it becomes much easier to troubleshoot errors or poor performance. How does this work? %if (&SQLXRC. NE 0) %then %do; %put ERROR: Return code: *&SQLXRC.*; %put ERROR- Error message: *&SQLXMSG.*.; %abort cancel; %end; Notes: The values reset with each statement that is executed 0 = no error; 4 = warning Must be using pass-through to an outside database

Tips for Mastering Relational Databases Using SAS/ACCESS® #3 – Use EXECUTE() for enhanced in-database functionality What does this mean? The EXECUTE() statement passes code directly to your database for execution (this is explicit pass-through). Why is this useful? Will run unaltered database-native code (i.e. not SAS-style PROC SQL code) Permits the use of DBMS-specific functionality such as calling stored procedures, using parameters, and using CTEs. How does this work? EXECUTE ( DECLARE @current_date_key int SET @current_date_key = (SELECT MAX(date_key) FROM example_table) SELECT id, sales INTO #sales_today FROM example_table WHERE (date_key = @current_date_key) ) BY DB_NAME;

How does this work? (MS SQL Server) Tips for Mastering Relational Databases Using SAS/ACCESS® #4 – Bring your SAS data into an external database What does this mean? Take SAS data (stored in WORK, or from another library) and load it into a relational database Why is this useful? Often the majority of your data does not reside in SAS, and you can push the work to your database If you are using SAS as an ETL (extract, transform, and load) tool Your pass-through run-times are unacceptably long How does this work? (MS SQL Server) proc SQL; CREATE TABLE DB.'#temp_table_name'n AS SELECT varName_1, varName_2 FROM WORK.exampleData; QUIT; Notes: A name-literal is required here because SAS does not consider ‘#’ to be a valid table name Syntax will vary depending on database used Some formats may not translate

Tips for Mastering Relational Databases Using SAS/ACCESS® #5 – Use your database's data-loader What does this mean? Every database has a data-loading utility, which SAS can use to load data Why is this useful? The SAS default is to use the SAS/ACCESS engine, which essentially does a row-by-row INSERT operation. Using your database's data-loader utility will vastly improve the speed of any append/insertion operations How does this work? proc SQL; CONNECT TO ODBC AS DB_NAME ( DSN = 'DWPROD10' BULKLOAD = yes); CREATE TABLE DB.exampleData AS SELECT * FROM WORK.exampleData; QUIT; Notes: User permissions are required on the database side There are many other options to tweak performance, such as READBUFF and INSERTBUFF

SAS and all other SAS Institute Inc SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies.