SlideShare a Scribd company logo
PROC SQL
IN SAS ENTERPRISE
GUIDE 4.3
Mark Tabladillo
December 12, 2011
About MarkTab
2


       Consultant: Data Mining Architect
         SAS  since 1991
         Microsoft MVP this year

         Presenting and Publishing since 1998

       Data Mining Blog http://www.marktab.net
       Twitter @marktabnet




                           (C) 2011 Mark Tabladillo
Purpose
3


       Provide basic vocabulary and pointers for
        absolute beginners
       Challenge intermediate-to-advanced users




                         (C) 2011 Mark Tabladillo
Outline
4


       Basics on Enterprise Guide 4.3
       PROC SQL
         SQL  Clauses
         Order of Operations – Best Practices

         Joins – Best Practices

         Macro variables




                           (C) 2011 Mark Tabladillo
(C) 2011 Mark Tabladillo   5




BASICS ON SAS
ENTERPRISE GUIDE
4.3
About SAS Enterprise Guide
6
    4.3
       Shipped July 2011
       New features include
         New  Program Editor with Autocomplete and
          Integrated Syntax Help
         Explicit SQL Pass-through Option

         Macro Variables for Conditional Processing
        http://support.sas.com/documentation/cdl/en/whatsnew/62580/HTML/default/viewer.htm#egwhatsnew43
        .htm




                                            (C) 2011 Mark Tabladillo
SAS Enterprise Guide 4.3
7
    Tutorial
       http://support.sas.com/documentation/onlinedoc/guide/tut43/en/




                                  (C) 2011 Mark Tabladillo
Tutorial Topics
8




                 (C) 2011 Mark Tabladillo
Enterprise Guide is Client
Software

                  SAS
                  on Windows
                                               SAS
                                               on Mainframe



                                             SAS
                                             on UNIX
 SAS Enterprise
 Guide
                  (C) 2011 Mark Tabladillo
                                                       9
The SAS Intelligence Platform
Architecture
  Enterprise Guide is fully integrated with the
    servers in the SAS 9 environment.




                          SAS Metadata Server
                                                                          SAS OLAP
                                                                          Server




   SAS Enterprise Guide                             SAS Stored Process Server


                                 SAS Workspace Server
                           (C) 2011 Mark Tabladillo
                                                                                10
(C) 2011 Mark Tabladillo   11




PROC SQL
SQL Clauses
Important in Enterprise Guide
12




                  (C) 2011 Mark Tabladillo
Autocompletion
13




                 (C) 2011 Mark Tabladillo
Typical SQL Statement – Six
14
     Clauses
     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
How many clauses are
15
     required?
     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
What is an example of a
16
     column?
     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
What is an example of a table?
17


     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
What is an example of an
18
     expression?
     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
What does DESC mean?
19


     SELECT column-1 <, ...column-n>
          FROM table-1|view-1<, ...table-n|view-n>
          <WHERE expression>
          <GROUP BY column-1 <, ....column-n>>
          <HAVING expression>
          <ORDER BY column-1 <DESC><, ...
     Column-n>>;
          quit;


                         (C) 2011 Mark Tabladillo
Mnemonic
20

     SELECT column-1 <, ...column-n>
              FROM table-1|view-1<, ...table-n|view-n>
              <WHERE expression>

              <GROUP BY column-1 <, ....column-n>>

              <HAVING expression>

              <ORDER BY column-1 <DESC><, ... Column-n>>;
               quit;

     SO
                FEW
                WORKERS
                GO
                HOME
                ON time!
                                           (C) 2011 Mark Tabladillo
(C) 2011 Mark Tabladillo   21




PROC SQL
Order of Operations – Best Practices
Order of Operations
22


        SQL is a declarative language
          You  declare the final product
          Then, the SQL interpreter decides how to create
           that final product




                            (C) 2011 Mark Tabladillo
Why try for one SELECT
23
     statement?
        SQL is a declarative language
          You  declare the final product
          Then, the SQL interpreter decides how to create
           that final product




                            (C) 2011 Mark Tabladillo
Order of Operations
24


     5   SELECT column-1 <, ...column-n>
           1
              FROM table-1|view-1<, ...table-n|view-n>
           2  <WHERE expression>
           3  <GROUP BY column-1 <, ....column-n>>
           4  <HAVING expression>
           6  <ORDER BY column-1 <DESC><, ...
         Column-n>>;
              quit;


                             (C) 2011 Mark Tabladillo
Best Practices?
25


     5   SELECT column-1 <, ...column-n>
           1
              FROM table-1|view-1<, ...table-n|view-n>
           2  <WHERE expression>
           3  <GROUP BY column-1 <, ....column-n>>
           4  <HAVING expression>
           6  <ORDER BY column-1 <DESC><, ...
         Column-n>>;
              quit;


                             (C) 2011 Mark Tabladillo
(C) 2011 Mark Tabladillo   26




PROC SQL
Joins – Best Practices
Joins
27

     Type                                   Description
     LEFT JOIN                              One to Many
     RIGHT JOIN                             Many to One
     FULL JOIN                              Many to Many, with Missing
     CROSS JOIN                             Product
     UNION JOIN                             Concatenation
     NATURAL JOIN                           Conservative Matching


        Recommended:
        Sams Teach Yourself SQL in 10 Minutes (3rd Edition) by Ben Forta
        Reference:
        http://support.sas.com/documentation/cdl/en/proc/61895/HTML/def
        ault/viewer.htm#a002473691.htm

                                   (C) 2011 Mark Tabladillo
Think Through Join Sources
28


        SAS can join
          SAS

          Excel

          Access

          Oracle

          Mainframe

          Text   Files



                          (C) 2011 Mark Tabladillo
Best Practice Rules
29


        Typed data is better than non-typed
        Subset better than the whole
        Native SQL better than SAS SQL
        In-memory data is faster than disk data
        Close to the server is better than far away –
         subset before moving
        SAS sources are better than not


                            (C) 2011 Mark Tabladillo
(C) 2011 Mark Tabladillo   30




PROC SQL
Macro Variables
PROC SQL Makes Macro
31
     Variables
     SELECT column-1 <, ...column-n>
             INTO macro-variable-specification
     < , ... macro-variable-specification>
             FROM table-1|view-1<, ...table-n|view-n>
             <WHERE expression>
             <GROUP BY column-1 <, ....column-n>>
             <HAVING expression>
             <ORDER BY column-1 <DESC><, ...
     Column-n>>;
             quit;         (C) 2011 Mark Tabladillo
What is a Macro Variable?
32


        Text Variable
        Stores Information in Memory
        Typically scoped to Global
        Dynamically Generated
          Useful as a prequel to a PROC SQL statement
          Useful as an Enterprise Guide 4.3 Condition




                           (C) 2011 Mark Tabladillo
Macro Variables as Conditions
33




                 (C) 2011 Mark Tabladillo
Defining a Macro Condition
34




                 (C) 2011 Mark Tabladillo
Process Flow Conditions
35




                 (C) 2011 Mark Tabladillo
Recommended
36


        http://support.sas.com
        Books
          Sams   Teach Yourself SQL in 10 Minutes (3rd
           Edition) by Ben Forta
          The Little SAS Book for Enterprise Guide 4.2 by
           Susan J. Slaughter and Lora D. Delwiche
          Professional SAS Programmer's Pocket
           Reference Sixth Edition by Rick Aster



                            (C) 2011 Mark Tabladillo
Conclusion
37


        Enterprise Guide 4.3 allows for simple through
         advanced processing with PROC SQL
        Many resources available:
          FreeSAS tutorials
          Books

          People




                               (C) 2011 Mark Tabladillo

More Related Content

What's hot

Proc report
Proc reportProc report
Proc report
eagebhart
 
SAS Macros
SAS MacrosSAS Macros
SAS Macros
guest2160992
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
Ali Ajouz
 
Sas practice programs
Sas practice programsSas practice programs
Sas practice programs
gowthami marreddy
 
Sas Plots Graphs
Sas Plots GraphsSas Plots Graphs
Sas Plots Graphs
guest2160992
 
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
Taddesse Kassahun
 
SQL
SQLSQL
Report procedure
Report procedureReport procedure
Report procedure
MaanasaS
 
A Step-By-Step Introduction to SAS Report Procedure
A Step-By-Step Introduction to SAS Report ProcedureA Step-By-Step Introduction to SAS Report Procedure
A Step-By-Step Introduction to SAS Report Procedure
YesAnalytics
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
izahn
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questionsDr P Deepak
 
Base SAS Full Sample Paper
Base SAS Full Sample Paper Base SAS Full Sample Paper
Base SAS Full Sample Paper
Jimmy Rana
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming Notes
Gnana Murthy A
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sashalasti
 
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
guest2160992
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
VARSHAKUMARI49
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
DataminingTools Inc
 
Arrays in SAS
Arrays in SASArrays in SAS
Arrays in SAS
guest2160992
 

What's hot (20)

Proc report
Proc reportProc report
Proc report
 
SAS Macros
SAS MacrosSAS Macros
SAS Macros
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
 
Sas practice programs
Sas practice programsSas practice programs
Sas practice programs
 
Sas Plots Graphs
Sas Plots GraphsSas Plots Graphs
Sas Plots Graphs
 
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
 
SQL
SQLSQL
SQL
 
Report procedure
Report procedureReport procedure
Report procedure
 
A Step-By-Step Introduction to SAS Report Procedure
A Step-By-Step Introduction to SAS Report ProcedureA Step-By-Step Introduction to SAS Report Procedure
A Step-By-Step Introduction to SAS Report Procedure
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
 
Sas summary guide
Sas summary guideSas summary guide
Sas summary guide
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
Base SAS Full Sample Paper
Base SAS Full Sample Paper Base SAS Full Sample Paper
Base SAS Full Sample Paper
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming Notes
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sas
 
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Arrays in SAS
Arrays in SASArrays in SAS
Arrays in SAS
 

Viewers also liked

Desayuno sma 06 09-2011
Desayuno sma 06 09-2011Desayuno sma 06 09-2011
Desayuno sma 06 09-2011
Pablo fondevila
 
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...cambridgeWD
 
Sas Enterprise Guide A Revolutionary Tool
Sas Enterprise Guide A Revolutionary ToolSas Enterprise Guide A Revolutionary Tool
Sas Enterprise Guide A Revolutionary Toolsysseminar
 
Hechsp 001 Chapter 3
Hechsp 001 Chapter 3Hechsp 001 Chapter 3
Hechsp 001 Chapter 3Brian Kelly
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1venkatam
 
Regression analysis
Regression analysisRegression analysis
Regression analysissaba khan
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
nadiazaheer
 
SAS basics Step by step learning
SAS basics Step by step learningSAS basics Step by step learning
SAS basics Step by step learning
Venkata Reddy Konasani
 
Regression analysis
Regression analysisRegression analysis
Regression analysisRavi shankar
 
Statistics
StatisticsStatistics
Statisticspikuoec
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis pptElkana Rorio
 

Viewers also liked (11)

Desayuno sma 06 09-2011
Desayuno sma 06 09-2011Desayuno sma 06 09-2011
Desayuno sma 06 09-2011
 
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
Clinical Trials Versus Health Outcomes Research: SAS/STAT Versus SAS Enterpri...
 
Sas Enterprise Guide A Revolutionary Tool
Sas Enterprise Guide A Revolutionary ToolSas Enterprise Guide A Revolutionary Tool
Sas Enterprise Guide A Revolutionary Tool
 
Hechsp 001 Chapter 3
Hechsp 001 Chapter 3Hechsp 001 Chapter 3
Hechsp 001 Chapter 3
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
SAS basics Step by step learning
SAS basics Step by step learningSAS basics Step by step learning
SAS basics Step by step learning
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Statistics
StatisticsStatistics
Statistics
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 

Similar to Proc SQL in SAS Enterprise Guide 4.3

Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosql
bharati k
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 CourseMarcus Davage
 
Getting Started with SQL Language.pptx
Getting Started with SQL Language.pptxGetting Started with SQL Language.pptx
Getting Started with SQL Language.pptx
Cecilia Brusatori
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
NR Computer Learning Center
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad Khorsun
Mind The Firebird
 
Oracle 10g
Oracle 10gOracle 10g
Oracle 10g
Svetlin Nakov
 
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
John Boyle
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005Govind Raj
 
Reporting Solution
Reporting SolutionReporting Solution
Reporting Solution
rahuldutta227
 
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Continuent
 
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Linas Virbalas
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
Eduardo Castro
 
War of the Indices- SQL Server and Oracle
War of the Indices-  SQL Server and OracleWar of the Indices-  SQL Server and Oracle
War of the Indices- SQL Server and Oracle
Kellyn Pot'Vin-Gorman
 
Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11
Abhishek Verma
 
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
Trivadis
 
Flink SQL & TableAPI in Large Scale Production at Alibaba
Flink SQL & TableAPI in Large Scale Production at AlibabaFlink SQL & TableAPI in Large Scale Production at Alibaba
Flink SQL & TableAPI in Large Scale Production at Alibaba
DataWorks Summit
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
georgette1200
 
SQL Server 2014 In-Memory Tables (XTP, Hekaton)
SQL Server 2014 In-Memory Tables (XTP, Hekaton)SQL Server 2014 In-Memory Tables (XTP, Hekaton)
SQL Server 2014 In-Memory Tables (XTP, Hekaton)
Tony Rogerson
 
Microsoft (SQL Server)
Microsoft (SQL Server)Microsoft (SQL Server)
Microsoft (SQL Server)Vinayak Hegde
 

Similar to Proc SQL in SAS Enterprise Guide 4.3 (20)

Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosql
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
 
Getting Started with SQL Language.pptx
Getting Started with SQL Language.pptxGetting Started with SQL Language.pptx
Getting Started with SQL Language.pptx
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad Khorsun
 
Oracle 10g
Oracle 10gOracle 10g
Oracle 10g
 
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
Oracle Database Administration Part I covering Both Oracle 11g r2 and 12c r1
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005
 
Reporting Solution
Reporting SolutionReporting Solution
Reporting Solution
 
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
 
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
War of the Indices- SQL Server and Oracle
War of the Indices-  SQL Server and OracleWar of the Indices-  SQL Server and Oracle
War of the Indices- SQL Server and Oracle
 
Abap tcodes
Abap tcodesAbap tcodes
Abap tcodes
 
Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11
 
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
Trivadis TechEvent 2016 Useful Oracle 12c Features for Data Warehousing by Da...
 
Flink SQL & TableAPI in Large Scale Production at Alibaba
Flink SQL & TableAPI in Large Scale Production at AlibabaFlink SQL & TableAPI in Large Scale Production at Alibaba
Flink SQL & TableAPI in Large Scale Production at Alibaba
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
 
SQL Server 2014 In-Memory Tables (XTP, Hekaton)
SQL Server 2014 In-Memory Tables (XTP, Hekaton)SQL Server 2014 In-Memory Tables (XTP, Hekaton)
SQL Server 2014 In-Memory Tables (XTP, Hekaton)
 
Microsoft (SQL Server)
Microsoft (SQL Server)Microsoft (SQL Server)
Microsoft (SQL Server)
 

More from Mark Tabladillo

How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006
Mark Tabladillo
 
Microsoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMicrosoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science Recap
Mark Tabladillo
 
201909 Automated ML for Developers
201909 Automated ML for Developers201909 Automated ML for Developers
201909 Automated ML for Developers
Mark Tabladillo
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
Mark Tabladillo
 
201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0
Mark Tabladillo
 
201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019
Mark Tabladillo
 
201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML
Mark Tabladillo
 
201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0
Mark Tabladillo
 
201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning
Mark Tabladillo
 
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
Mark Tabladillo
 
Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904
Mark Tabladillo
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904
Mark Tabladillo
 
Training of Python scikit-learn models on Azure
Training of Python scikit-learn models on AzureTraining of Python scikit-learn models on Azure
Training of Python scikit-learn models on Azure
Mark Tabladillo
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
Mark Tabladillo
 
Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808
Mark Tabladillo
 
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Mark Tabladillo
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017
Mark Tabladillo
 
Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612
Mark Tabladillo
 
How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610
Mark Tabladillo
 
Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016
Mark Tabladillo
 

More from Mark Tabladillo (20)

How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006
 
Microsoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMicrosoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science Recap
 
201909 Automated ML for Developers
201909 Automated ML for Developers201909 Automated ML for Developers
201909 Automated ML for Developers
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0
 
201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019
 
201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML
 
201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0
 
201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning
 
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
 
Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904
 
Training of Python scikit-learn models on Azure
Training of Python scikit-learn models on AzureTraining of Python scikit-learn models on Azure
Training of Python scikit-learn models on Azure
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
 
Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808
 
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017
 
Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612
 
How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610
 
Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016
 

Recently uploaded

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Proc SQL in SAS Enterprise Guide 4.3

  • 1. PROC SQL IN SAS ENTERPRISE GUIDE 4.3 Mark Tabladillo December 12, 2011
  • 2. About MarkTab 2  Consultant: Data Mining Architect  SAS since 1991  Microsoft MVP this year  Presenting and Publishing since 1998  Data Mining Blog http://www.marktab.net  Twitter @marktabnet (C) 2011 Mark Tabladillo
  • 3. Purpose 3  Provide basic vocabulary and pointers for absolute beginners  Challenge intermediate-to-advanced users (C) 2011 Mark Tabladillo
  • 4. Outline 4  Basics on Enterprise Guide 4.3  PROC SQL  SQL Clauses  Order of Operations – Best Practices  Joins – Best Practices  Macro variables (C) 2011 Mark Tabladillo
  • 5. (C) 2011 Mark Tabladillo 5 BASICS ON SAS ENTERPRISE GUIDE 4.3
  • 6. About SAS Enterprise Guide 6 4.3  Shipped July 2011  New features include  New Program Editor with Autocomplete and Integrated Syntax Help  Explicit SQL Pass-through Option  Macro Variables for Conditional Processing http://support.sas.com/documentation/cdl/en/whatsnew/62580/HTML/default/viewer.htm#egwhatsnew43 .htm (C) 2011 Mark Tabladillo
  • 7. SAS Enterprise Guide 4.3 7 Tutorial  http://support.sas.com/documentation/onlinedoc/guide/tut43/en/ (C) 2011 Mark Tabladillo
  • 8. Tutorial Topics 8 (C) 2011 Mark Tabladillo
  • 9. Enterprise Guide is Client Software SAS on Windows SAS on Mainframe SAS on UNIX SAS Enterprise Guide (C) 2011 Mark Tabladillo 9
  • 10. The SAS Intelligence Platform Architecture Enterprise Guide is fully integrated with the servers in the SAS 9 environment. SAS Metadata Server SAS OLAP Server SAS Enterprise Guide SAS Stored Process Server SAS Workspace Server (C) 2011 Mark Tabladillo 10
  • 11. (C) 2011 Mark Tabladillo 11 PROC SQL SQL Clauses
  • 12. Important in Enterprise Guide 12 (C) 2011 Mark Tabladillo
  • 13. Autocompletion 13 (C) 2011 Mark Tabladillo
  • 14. Typical SQL Statement – Six 14 Clauses SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 15. How many clauses are 15 required? SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 16. What is an example of a 16 column? SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 17. What is an example of a table? 17 SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 18. What is an example of an 18 expression? SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 19. What does DESC mean? 19 SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 20. Mnemonic 20 SELECT column-1 <, ...column-n> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; SO FEW WORKERS GO HOME ON time! (C) 2011 Mark Tabladillo
  • 21. (C) 2011 Mark Tabladillo 21 PROC SQL Order of Operations – Best Practices
  • 22. Order of Operations 22  SQL is a declarative language  You declare the final product  Then, the SQL interpreter decides how to create that final product (C) 2011 Mark Tabladillo
  • 23. Why try for one SELECT 23 statement?  SQL is a declarative language  You declare the final product  Then, the SQL interpreter decides how to create that final product (C) 2011 Mark Tabladillo
  • 24. Order of Operations 24 5 SELECT column-1 <, ...column-n> 1 FROM table-1|view-1<, ...table-n|view-n> 2 <WHERE expression> 3 <GROUP BY column-1 <, ....column-n>> 4 <HAVING expression> 6 <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 25. Best Practices? 25 5 SELECT column-1 <, ...column-n> 1 FROM table-1|view-1<, ...table-n|view-n> 2 <WHERE expression> 3 <GROUP BY column-1 <, ....column-n>> 4 <HAVING expression> 6 <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 26. (C) 2011 Mark Tabladillo 26 PROC SQL Joins – Best Practices
  • 27. Joins 27 Type Description LEFT JOIN One to Many RIGHT JOIN Many to One FULL JOIN Many to Many, with Missing CROSS JOIN Product UNION JOIN Concatenation NATURAL JOIN Conservative Matching Recommended: Sams Teach Yourself SQL in 10 Minutes (3rd Edition) by Ben Forta Reference: http://support.sas.com/documentation/cdl/en/proc/61895/HTML/def ault/viewer.htm#a002473691.htm (C) 2011 Mark Tabladillo
  • 28. Think Through Join Sources 28  SAS can join  SAS  Excel  Access  Oracle  Mainframe  Text Files (C) 2011 Mark Tabladillo
  • 29. Best Practice Rules 29  Typed data is better than non-typed  Subset better than the whole  Native SQL better than SAS SQL  In-memory data is faster than disk data  Close to the server is better than far away – subset before moving  SAS sources are better than not (C) 2011 Mark Tabladillo
  • 30. (C) 2011 Mark Tabladillo 30 PROC SQL Macro Variables
  • 31. PROC SQL Makes Macro 31 Variables SELECT column-1 <, ...column-n> INTO macro-variable-specification < , ... macro-variable-specification> FROM table-1|view-1<, ...table-n|view-n> <WHERE expression> <GROUP BY column-1 <, ....column-n>> <HAVING expression> <ORDER BY column-1 <DESC><, ... Column-n>>; quit; (C) 2011 Mark Tabladillo
  • 32. What is a Macro Variable? 32  Text Variable  Stores Information in Memory  Typically scoped to Global  Dynamically Generated  Useful as a prequel to a PROC SQL statement  Useful as an Enterprise Guide 4.3 Condition (C) 2011 Mark Tabladillo
  • 33. Macro Variables as Conditions 33 (C) 2011 Mark Tabladillo
  • 34. Defining a Macro Condition 34 (C) 2011 Mark Tabladillo
  • 35. Process Flow Conditions 35 (C) 2011 Mark Tabladillo
  • 36. Recommended 36  http://support.sas.com  Books  Sams Teach Yourself SQL in 10 Minutes (3rd Edition) by Ben Forta  The Little SAS Book for Enterprise Guide 4.2 by Susan J. Slaughter and Lora D. Delwiche  Professional SAS Programmer's Pocket Reference Sixth Edition by Rick Aster (C) 2011 Mark Tabladillo
  • 37. Conclusion 37  Enterprise Guide 4.3 allows for simple through advanced processing with PROC SQL  Many resources available:  FreeSAS tutorials  Books  People (C) 2011 Mark Tabladillo