56
PART 3
Working with Transformations
351
Chapter 18 • Working with Analysis Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
About Analysis Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Creating a Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Creating a Distribution Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Generating Forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Frequency of Eye Color By Hair Color Crosstabulation . . . . . . . . . . . . . . . . . . . . . . . 377
One-Way Frequency of Eye Color By Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Creating Summary Statistics for a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Creating a Summary Tables Report from Table Data . . . . . . . . . . . . . . . . . . . . . . . . . 405
Chapter 19 • Working with Loader Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
About Loader Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
About the SPD Server Table Loader Transformation . . . . . . . . . . . . . . . . . . . . . . . . . 414
Teradata Table Loader Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
About the Table Loader Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
About the Oracle Bulk Table Loader Transformation . . . . . . . . . . . . . . . . . . . . . . . . . 417
About the DB2 Bulk Table Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Setting Table Loader Transformation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Selecting a Load Technique in the Table Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Removing Non-Essential Indexes and Constraints during a Load . . . . . . . . . . . . . . . . 424
Considering a Bulk Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Chapter 20 • Working with SAS Sort Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
About Sort Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Optimizing Sort Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Creating a Table That Contains the Sorted Contents of a Source . . . . . . . . . . . . . . . . 430
Chapter 21 • Working with SQL Join Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
About Join Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Using the Designer Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Reviewing and Modifying Clauses, Joins, and Tables in an SQL Query . . . . . . . . . . . 437
Understanding Automatic Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Selecting the Join Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Adding User-Written SQL Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Debugging an SQL Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Adding a Column to the Target Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Adding a Join to an SQL Query on the Designer Tab . . . . . . . . . . . . . . . . . . . . . . . . . 447
Creating a Simple SQL Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Configuring a SELECT Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Adding a CASE Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Creating or Configuring a WHERE Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Adding a GROUP BY Clause and a HAVING Clause . . . . . . . . . . . . . . . . . . . . . . . . 457
Adding an ORDER BY Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Adding Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Validating or Submitting an SQL Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Joining a Table to Itself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Using Parameters with an SQL Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Constructing a SAS Scalable Performance Data Server Star Join . . . . . . . . . . . . . . . . 470
Optimizing SQL Processing Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Performing General Data Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Influencing the Join Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Setting the Implicit Property for a Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Enabling Explicit Pass-Through Processing for SQL Join Transformations . . . . . . . . 476
Using Properties Window Options to Optimize SQL Processing Performance . . . . . . 478
Contents
ix