Managing Processing Using PROC SQL Chapter 8 1 Imelda Go, John Grego, Jennifer Lasecki, 2011.

Slides:



Advertisements
Similar presentations
Haas MFE SAS Workshop Lecture 3:
Advertisements

Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Chapter 5: Creating and Managing Tables using PROC SQL 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 9: Introducing Macro Variables 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 3. Expressions and Interactivity CSC125 Introduction to C++
Creating and Managing Views Using PROC SQL Chapter 7 1.
Correlated Subqueries Chapter 2 Supplement 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Performing Queries Using PROC SQL Chapter 1 1 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
Chapter 18: Modifying SAS Data Sets and Tracking Changes 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 3: Combining Tables Horizontally using PROC SQL 1 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
SAS SQL SAS Seminar Series
Chapter 10:Processing Macro Variables at Execution Time 1 STAT 541 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Chapter 8: Additional PROC SQL Features
©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina Chapter 17 supplement: Review of Formatting Data STAT 541.
Creating and Managing Indexes Using Proc SQL Chapter 6 1.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Chapter 15: Combining Data Horizontally 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction to Using the Data Step Hash Object with Large Data Sets Richard Allen Peak Stat.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
Chapter 16: Using Lookup Tables to Match Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Chapter 22: Using Best Practices 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Performing Advanced Queries Using PROC SQL Chapter 2 1.
Chapter 17: Formatting Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
 Structure charts (last lesson)  Screen and page layout diagrams provide  A sketch of each page (screen) of the program  A list of the content, including.
Chapter 19: Introduction to Efficient SAS Programming 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Chapter 4: Combining Tables Vertically using PROC SQL 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 17 Supplement: Alternatives to IF-THEN/ELSE Processing STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South.
Chapter 23: Selecting Efficient Sorting Strategies 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 21: Controlling Data Storage Space 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Chapter 3 Table Creation and Management Oracle 10g: SQL.
Chapter 14: Combining Data Vertically 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Using Dictionary Tables to Profile SAS Datasets By Phillip Julian February 11, 2011.
 CONACT UC:  Magnific training   
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Oracle 11g: SQL Chapter 5 Data Manipulation and Transaction Control.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Chapter 5: Enhancing Your Output with ODS
Insert, Update and the rest…
SQL Creating and Managing Tables
Chapter 19: Introduction to Efficient SAS Programming
Self-joins Using PROC SQL
PROC SQL, Overview.
Chapter 18: Modifying SAS Data Sets and Tracking Changes
Former Chapter 23: Selecting Efficient Sorting Strategies
SQL Creating and Managing Tables
SQL Creating and Managing Tables
Chapter 24 (4th ed.): Creating Functions
Integrity Constraints
Program Testing and Performance
Using Macros to Solve the Collation Problem
Dictionary Tables and Views, obtain information about SAS files
5 The EXCEPT Operator Unique rows from the first result set that are not found in the second result set are selected.
Creating Tables Create a new table by defining the column structure.
Setting SQL Procedure Options
Chapter 24: Querying Data Efficiently
SQL set operators and modifiers.
Lesson 5: HTML Tables.
UNION Operator keywords Displays all rows from both the tables
P 72 (PDF 76) Figure 32 Information item name Rules in columns
Presentation transcript:

Managing Processing Using PROC SQL Chapter 8 1 Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS INOBS= INOBS= –Used to restrict the number of input rows –Useful for possibly large queries (e.g., outer unions) proc sql inobs=5; select * from Ecoli outer union corr select * from Fcoli outer union corr select * from Entero; quit; 2Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS OUTOBS= OUTOBS= –Used to restrict the number of output rows –OUTOBS= by itself restores the default (all rows output) 3Imelda Go, John Grego, Jennifer Lasecki, 2011

Example: OUTOBS proc sql outobs=5; select player, atbats select player, atbats from bbstats; from bbstats;quit; playeratbats Christian Walker271 Scott Wingo240 Brady Thomas231 Evan Marzilli220 Robert Beary211 4Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS DOUBLE/NODOUBLE DOUBLE/NODOUBLE –specifies whether output is double spaced –this option does not affect the appearance of HTML output proc sql outobs=5 double; select player, atbats select player, atbats from bbstats; from bbstats;quit; 5Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS NUMBER/NONUMBER NUMBER/NONUMBER –Adds or removes row numbers from a table –The column is labeled: Row –Similar to OBS/NOOBS in PROC PRINT proc sql outobs=5 double number; select player, atbats select player, atbats from bbstats; from bbstats;quit; 6Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS  FLOW | NOFLOW FLOW=n | FLOW=n m –Controls appearance of wide character columns in listing output –n sets the width of the flowed column –Specifying n and m floats the width of the column between limits –does not affect the appearance of HTML, PDF, or RTF output 7Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS  Example of FLOW proc sql flow = double; select winner.wscore label="Matching Score", winner.date format=worddate18. label="Date", winner.wteam label="Team with Winning Score", loser.date format=worddate18. label="Date", loser.lteam label="Team with Losing Score" from secscores as winner, secscores as loser where winner.wscore=loser.lscore; quit; 8Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS  RESET can be used to change OUTOBS=, NUMBER, NODOUBLE, NOFLOW, etc  It can be inserted between SELECT clauses to restore options 9Imelda Go, John Grego, Jennifer Lasecki, 2011

PROC SQL OPTIONS  Example of RESET proc sql outobs=6 double; select player, atbats from bbstats; reset outobs= number nodouble; select player, hits from bbstats; quit; 10Imelda Go, John Grego, Jennifer Lasecki, 2011

Timing Information  When learning about indexes in Chapter 6, we used the default timing information available in the SAS Log  Timing info can be disaggregated by task using the STIMER option  Additional task info can be obtained using FULLSTIMER  Both methods are useful for benchmarking Imelda Go, John Grego, Jennifer Lasecki,

Timing Information  If CPU Time is close to Real Time, than the system is operating efficiently  In addition to Real Time and CPU Time, FULLSTIMER provides data on -Memory -Involuntary CPU time-slice releases -Page swaps Imelda Go, John Grego, Jennifer Lasecki,

Dictionaries  DICTIONARY.TABLES contains meta data about tables and views  DICTIONARY.COLUMNS contains meta data about columns in tables  Can be compared to PROC CONTENTS Imelda Go, John Grego, Jennifer Lasecki,

Dictionaries  To find what variables are available, use DESCRIBE TABLE  A specific query proc sql; select memname, memtype, nobs, nvar, num_character, num_numeric, filesize, crdate from dictionary.tables where libname='WORK'; quit; Imelda Go, John Grego, Jennifer Lasecki,