SlideShare une entreprise Scribd logo
1  sur  37
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

Contenu connexe

Tendances

SAS Access / SAS Connect
SAS Access / SAS ConnectSAS Access / SAS Connect
SAS Access / SAS Connectguest2160992
 
Utility Procedures in SAS
Utility Procedures in SASUtility Procedures in SAS
Utility Procedures in SASguest2160992
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Languageguest2160992
 
Understanding sas data step processing.
Understanding sas data step processing.Understanding sas data step processing.
Understanding sas data step processing.Ravi Mandal, MBA
 
Report procedure
Report procedureReport procedure
Report procedureMaanasaS
 
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWTHARUN PORANDLA
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1venkatam
 
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 ProcedureYesAnalytics
 
Introduction to SAS Data Set Options
Introduction to SAS Data Set OptionsIntroduction to SAS Data Set Options
Introduction to SAS Data Set OptionsMark Tabladillo
 
Conditional statements in sas
Conditional statements in sasConditional statements in sas
Conditional statements in sasvenkatam
 
An introduction to SQLAlchemy
An introduction to SQLAlchemyAn introduction to SQLAlchemy
An introduction to SQLAlchemymengukagan
 
SAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptxSAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptxAvinabaMukherjee6
 
SQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionSQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionJason Myers
 

Tendances (20)

SAS Access / SAS Connect
SAS Access / SAS ConnectSAS Access / SAS Connect
SAS Access / SAS Connect
 
Utility Procedures in SAS
Utility Procedures in SASUtility Procedures in SAS
Utility Procedures in SAS
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Language
 
Sas practice programs
Sas practice programsSas practice programs
Sas practice programs
 
Understanding sas data step processing.
Understanding sas data step processing.Understanding sas data step processing.
Understanding sas data step processing.
 
SAS basics Step by step learning
SAS basics Step by step learningSAS basics Step by step learning
SAS basics Step by step learning
 
Report procedure
Report procedureReport procedure
Report procedure
 
Arrays in SAS
Arrays in SASArrays in SAS
Arrays in SAS
 
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXW
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
 
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 Data Set Options
Introduction to SAS Data Set OptionsIntroduction to SAS Data Set Options
Introduction to SAS Data Set Options
 
Conditional statements in sas
Conditional statements in sasConditional statements in sas
Conditional statements in sas
 
An introduction to SQLAlchemy
An introduction to SQLAlchemyAn introduction to SQLAlchemy
An introduction to SQLAlchemy
 
SAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptxSAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptx
 
Sas array statement
Sas array statementSas array statement
Sas array statement
 
SQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionSQLAlchemy Core: An Introduction
SQLAlchemy Core: An Introduction
 
Proc report
Proc reportProc report
Proc report
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
SAS Macro
SAS MacroSAS Macro
SAS Macro
 

En vedette

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
 
Regression analysis
Regression analysisRegression analysis
Regression analysissaba khan
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysisnadiazaheer
 
Regression analysis
Regression analysisRegression analysis
Regression analysisRavi shankar
 
Statistics
StatisticsStatistics
Statisticspikuoec
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis pptElkana Rorio
 

En vedette (9)

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
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Statistics
StatisticsStatistics
Statistics
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 

Similaire à 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 nosqlbharati 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.pptxCecilia Brusatori
 
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 KhorsunMind The Firebird
 
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 r1John 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
 
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 AnalyticsContinuent
 
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 AnalyticsLinas Virbalas
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012Eduardo 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 OracleKellyn 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_V11Abhishek 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 AlibabaDataWorks Summit
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Groupgeorgette1200
 
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
 

Similaire à 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)
 

Plus de 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 202006Mark Tabladillo
 
Microsoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMicrosoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMark Tabladillo
 
201909 Automated ML for Developers
201909 Automated ML for Developers201909 Automated ML for Developers
201909 Automated ML for DevelopersMark Tabladillo
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated MLMark 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.0Mark 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 2019Mark Tabladillo
 
201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusMLMark 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.0Mark Tabladillo
 
201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine LearningMark 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 201904Mark Tabladillo
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Mark 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 AzureMark 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 AzureMark Tabladillo
 
Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Mark 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 2017Mark Tabladillo
 
Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Mark 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 201610Mark 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 2016Mark Tabladillo
 

Plus de 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
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

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