Module-1 SAS Base Programming
Part-1 Access and Create Data Structures
· Lecture-1 SAS Programs
· Introduction to SAS programs
· Submitting a SAS program
· Working with SAS program syntax
· Lecture-2 Create temporary and permanent SAS data sets.
· Use a DATA step to create a SAS data set from an existing SAS data set.
· Example:
· Data Mylib.NewData;
· Set Mylib.OldData;
· <other SAS statements>
· Run;
· Lecture-3 Investigate SAS data libraries using base SAS utility procedures.
· Use a LIBNAME statement to assign a library reference name to a SAS library.
· Investigate a library programmatically using the CONTENTS procedure.
· Lecture-4 Combine SAS data sets.
· Concatenate data sets.
· Merge data sets one-to-one.
· Merge data sets one-to-many.
· Lecture-5 Access an Excel workbook.
· Use the SAS/ACCESS XLSX engine to read an .xlsx file.
· Lecture-6 Create and manipulate SAS date values.
· Explain how SAS stores date and time values.
· Use SAS date and time formats to specify how the values are displayed.
· Lecture-7 Export data to create standard and comma-delimited raw data files.
· Create a simple raw data file by using the EXPORT procedure as an alternative to the DATA step.
· Lecture-8 Control which observations and variables in a SAS data set are processed and output.
· Use the WHERE statement in the DATA step to select observations to be processed.
· Subset variables to be output by using the DROP and KEEP statements.
· Use the DROP= and KEEP= data set options to specify columns to be processed and/or output.
Part-2 Manage Data
· Lecture-9 Sort observations in a SAS data set.
· Use the SORT Procedure to re-order observations in place or output to a new dataset.
· Lecture-10 Conditionally execute SAS statements.
· Use IF-THEN/ELSE statements to process data conditionally.
· Use DO and END statements to execute multiple statements conditionally.
· Lecture-11 Use assignment statements in the DATA step.
· Create new variables and assign a value.
· Assign a new value to an existing variable.
· Assign the value of an expression to a variable.
· Assign a constant date value to a variable.
· Lecture-12 Modify variable attributes using options and statements in the DATA step.
· Change the names of variables by using the RENAME= data set option.
· Use LABEL and FORMAT statements to modify attributes in a DATA step.
· Define the length of a variable using the LENGTH statement.
· Lecture-13 Accumulate sub-totals and totals using DATA step statements.
· Use the BY statement to aggregate by subgroups.
· Lecture-14 Use SAS functions to manipulate character data, numeric data, and SAS date values.
· Use SAS functions such as SCAN, SUBSTR, TRIM, UPCASE, and LOWCASE to perform tasks such as the tasks shown below.
· Replace the contents of a character value.
· Trim trailing blanks from a character value.
· Search a character value and extract a portion of the value.
· Convert a character value to upper or lowercase.
· Use SAS arithmetic, financial, and probability functions to create or modify numeric values by using the INT and ROUND functions.
· Create SAS date values by using the functions MDY, TODAY,DATE, and TIME.
· Extract the month, year, and interval from a SAS date value by using the functions YEAR, QTR, MONTH, and DAY.
· Perform calculations with date and datetime values and time intervals by using the functions INTCK, INTNX, DATDIF and YRDIF.
· Lecture-15 Use SAS functions to convert character data to numeric and vice versa.
· Explain the automatic conversion that SAS uses to convert values between data types.
· Use the INPUT function to explicitly convert character data values to numeric values.
· Lecture-16 Process data using DO LOOPS.
· Explain how iterative DO loops function.
· Use DO loops to eliminate redundant code and to perform repetitive calculations.
· Use conditional DO loops.
· Use nested DO loops.
· Lecture-17 Validate and clean data.
· Use PROC FREQ to list unique values, with the nlevel option to show the number of distinct values, with the order=freq to check for duplicate or missing values.
· Use PROC PRINT with the WHERE statement to display observations with invalid values.
· Use PROC MEAN to validate the range of numeric variables.
· Use PROC UNIVARIATE to display extreme observations and missing values and with the ID statement to display the value of identifying variable(s)
Part-3 Generate Reports
· Lecture-18 Generate list reports using the PRINT procedure.
· Modify the default behavior of PROC PRINT by adding statements and options such as
· use the VAR statement to select and order variables.
· calculate totals with a SUM statement.
· select observations with a WHERE statement.
· use the ID statement to identify observations.
· use the BY statement to process groups.
· Lecture-19 Generate summary reports and frequency tables using base SAS procedures.
· Produce one-way and two-way frequency tables with the FREQ procedure.
· Enhance frequency tables with options.
· Use PROC FREQ to validate data in a SAS data set.
· Calculate summary statistics and multilevel summaries using the MEANS procedure
· Enhance summary tables with options.
· Identify extreme and missing values with the UNIVARIATE procedure.
· Lecture-20 Enhance reports through the use of user-defined formats, titles, footnotes and SAS System reporting.
· Use the LABEL statement to define descriptive column headings.
· Control the use of column headings with the LABEL and SPLIT=options in Proc Print output.
· Lecture-21 Generate reports using ODS statements.
· Identify the Output Delivery System destinations.
· Create HTML, PDF, RTF, and files with ODS statements.
· Use the STYLE=option to specify a style template.
· Create files that can be viewed in Microsoft Excel.
Part-4 Error Handling
· Lecture-22 Identify and resolve programming logic errors.
· Use the PUTLOG Statement in the Data Step to help identify logic errors.
· Use PUTLOG to write the value of a variable, formatted values, or to write values of all variables.
· Use PUTLOG with Conditional logic.
· Use temporary variables N and ERROR to debug a DATA step.
· Lecture-23 Recognize and correct syntax errors.
· Identify the characteristics of SAS statements.
· Define SAS syntax rules including the typical types of syntax errors such as misspelled keywords, unmatched quotation marks, missing semicolons, and invalid options.
· Use the log to help diagnose syntax errors in a given program.
· Lecture-24 Examine and resolve data errors.
· Given a SAS program, use the log to determine the reason for a data error.
Module-2 SAS Advance Programming
Part-1 Accessing Data Using SQL
· Lecture-1 Generate detail reports in SQL
· Use PROC SQL to perform SQL queries.
· Select columns in a table with a SELECT statement and FROM clause.
· Create a table from a query result set.
· Create new calculated columns.
· Assign an alias with the AS keyword.
· Use case logic to select values for a column.
· Retrieve rows that satisfy a condition with a WHERE clause.
· Subset data by calculated columns.
· Join tables - inner joins, full joins (coalesce function), right joins, left joins.
· Combine tables using set operators - union, outer union, except, intersect.
· Sort data with an ORDER BY clause.
· Assign labels and formats to columns.
· Lecture-2 Generate summary reports in the SQL.
· Summarize data across and down columns using summary functions (AVG, COUNT, MAX, MIN, SUM).
· Group data using GROUP BY clause.
· Filter grouped data using HAVING clause.
· Eliminate duplicate values with the DISTINCT keyword.
· Lecture-3 Construct sub-queries and in-line views.
· Subset data by using non-correlated subqueries.
· Reference an in-line view with other views or tables (multiple tables).
· Lecture-4 Use SAS SQL procedure enhancements.
· Use SAS data set options with PROC SQL (KEEP=, DROP=, RENAME=, OBS=).
· Use PROC SQL invocation options (INOBS=, OUTOBS=. NOPRINT, NUMBER)
· Use SAS functions (SCAN, SUBSTR, LENGTH).
· Access SAS system information by using DICTIONARY tables (members, tables, columns)
· Use the CALCULATED keyword.
Part-2 Macro Processing
· Lecture-5 Uuse user-defined and automatic macro variables
· Use macro variable name delimiter. (.)
· Use INTO clause of the SELECT statement in SQL to create a single variable or a list of variables.
· Use the SYMPUTX routine in a DATA Step to create a single variable or a list of variables.
· Control variable scope
· Lecture-6 Automate programs by defining and calling macros.
· Define a macro using the %MACRO and %MEND statements.
· Calling a macro with and without parameters.
· Document macro functionality with comments
· Generate SAS Code conditionally by using the %IF-%THEN-%ELSE macro statements or iterative %DO statements.
· Use the SAS AUTOCALL facility to permanently store and call macros.
· Lecture-7 Use macro functions.
· Use macro functions. (%SCAN, %SUBSTR, %UPCASE)
· Use macro quoting functions. (%NRSTR, %STR)
· Use macro evaluation functions. (%SYSEVALF)
· Use %SYSFUNC to execute DATA step functions within the SAS Macro Language.
· Lecture-8 Debug macros.
· Trace the flow of execution with the MLOGIC option.
· Examine the generated SAS statements with the MPRINT option.
· Examine macro variable resolution with the SYMBOLGEN option.
· Use the %PUT statement to print information to the log.
· Lecture-9 Data-driven programs using SAS Macro Language.
· Create a series of macro variables.
· Use indirect reference to macro variables. (&&, etc.)
· Incorporate DICTONARY tables in data driven macros.
· Generate repetitive macro calls.
Part-3 Advanced Techniques
· Lecture-10 Process data using 1 and 2 dimensional arrays.
· Define and use character arrays.
· Define and use numeric arrays.
· Create variables with arrays.
· Reference arrays within a DO loop.
· Specify the array dimension with the DIM function.
· Define arrays as temporary arrays.
· Load initial values for an array from a SAS data set.
· Lecture-11 Process data using hash objects.
· Declare hash and hash iterator objects
· Dataset argument
· Ordered argument
· Multidata argument
· Use hash object methods
· definekey()
· definedata()
· definedone()
· find()
· add()
· output()
· Use hash iterator object methods
· first()
· next()
· last()
· prev()
· Use hash objects as lookup tables.
· Use hash objects to create sorted data sets.
· Use hash iterator objects to access data in forward or reverse key order.
· Lecture-12 Use SAS utility procedures.
· Specify a template using the PICTURE statement within the FORMAT Procedure*
· Specify templates for date, time, and datetime values using directives.
· Specify templates for numeric values using digit selectors.
· PICTURE statement options: round, default, datatype, multiplier, prefix
· Create custom functions with the FCMP procedure
· Create character and numeric custom functions with single or multiple arguments.
· Create custom functions based on conditional processing.
· Use custom functions with the global option CMPLIB=.
· Lecture-13 Use advanced functions.
· Finding strings or words with the FINDC/FINDW functions.
· Counting strings or words with the COUNT/COUNTC/COUNTW functions.
· Retrieve previous values with the LAG function.
· Regular expression pattern matching with PRX functions
Module-3 SAS/ETS Programming Training
Part-1 Overview of Time Series
· Lecture-1 Introduction
· Lecture-2 Analysis Methods and SAS/ETS Software
· Options
· How SAS/ETS Software Procedures Interrelate
· Lecture-3 Simple Models: Regression
· Linear Regression
· Highly Regular Seasonality
· Regression with Transformed Data
Part-2 Simple Models: Autoregression
· Lecture-4 Introduction
· Terminology and Notation
· Statistical Background
· Lecture-5 Forecasting
· Forecasting with PROC ARIMA
· Backshift Notation B for Time Series
· Yule-Walker Equations for Covariances
· Fitting an AR Model in PROC REG
Part-3 General ARIMA Model
· Lecture-6 Introduction
· Statistical Background
· Terminology and Notation
· Lecture-7 Prediction
· One-Step-Ahead Predictions
· Future Predictions
· Lecture-8 Model Identification
· Stationarity and Invertibility
· Time Series Identification
· Chi-Squared Check of Residuals
· Summary of Model Identification
· Lecture-9 Examples and Instructions
· IDENTIFY Statement for Series
· Example: Iron and Steel Export Analysis
· Estimation Methods Used in PROC ARIMA
· ESTIMATE Statement for Series
· Nonstationary Series
· Effect of Differencing on Forecasts
· Examples: Forecasting IBM Series and Silver Series
· Models for Nonstationary Data
· Differencing to Remove a Linear Trend
· Other Identification Techniques
Part-4 ARIMA Model: Introductory Applications
· Lecture-10 Seasonal Time Series
· Introduction to Seasonal Modeling
· Model Identification
· Lecture-11 Models with Explanatory Variables
· Case 1: Regression with Time Series Errors
· Case 1A: Intervention
· Case 2: Simple Transfer Function
· Case 3: General Transfer Function
· Case 3A: Leading Indicators
· Case 3B: Intervention
· Lecture-12 Methodology and Example
· Case 1: Regression with Time Series Errors
· Case 2: Simple Transfer Functions
· Case 3: General Transfer Functions
· Case 3B: Intervention
· Lecture-13 Further Examples
· North Carolina Retail Sales
· Construction Series Revisited
· Milk Scare (Intervention)
· Terrorist Attack
Part-5 ARIMA Model: Special Applications
· Lecture-14 Regression with Time Series Errors and Unequal Variances
· Autoregressive Errors
· Example: Energy Demand at a University
· Unequal Variances
· ARCH, GARCH, and IGARCH for Unequal Variances
· Lecture-15 Cointegration
· Introduction
· Cointegration and Eigenvalues
· Impulse Response Function
· Roots in Higher-Order Models
· Cointegration and Unit Roots
· An Illustrative Example
· Estimating the Cointegrating Vector
· Intercepts and More Lags
· PROC VARMAX
· Interpreting the Estimates
· Diagnostics and Forecasts
Part-6 State Space Modeling
· Lecture-16 Introduction
· Some Simple Univariate Examples
· A Simple Multivariate Example
· Equivalence of Statespace and Vector ARMA Models
· Lecture-17 More Examples
· Some Univariate Examples
· ARMA (1, 1) of Dimension
· Lecture-18 PROC STATESPACE
· State Vectors Determined from Covariances
· Canonical Correlations
· Simulated Example
· Lecture-18 PROC STATESPACE
· State Vectors Determined from Covariances
· Canonical Correlations
· Simulated Example
· Practical Exercise
Part-7 Spectral Analysis
· Lecture-19 Periodic Data: Introduction
· Example: Plant Enzyme Activity
· PROC SPECTRA Introduced
· Testing for White Noise
· Harmonic Frequencies
· Extremely Fast Fluctuations and Aliasing
· The Spectral Density
· Some Mathematical Detail (Optional Reading)
· Estimating the Spectrum: The Smoothed Periodogram
· Cross Spectral Analysis
· Interpreting Cross-Spectral Quantities
· Interpreting Cross-Amplitude and Phase Spectra
· PROC SPECTRA Statements
· Cross-Spectral Analysis of the Neuse River Data
· Details on Gain, Phase, and Pure Delay
Part-8 Data Mining and Forecasting
· Lecture-20 Introduction Data Mining and Forecasting
· Forecasting Data Model
· Time Series Forecasting System
· HPF Procedure
· Scorecard Development
· Business Goal Performance Metrics
· Graphical Displays
· Goal-Seeking Model Development