Chapter 1: Introduction To SAS

  • Introduction
  • Need for SAS
  • Who uses SAS
  • What is SAS?
  • Overview of BASE SAS SOFTWARE
  • Data management facility
  • Structure of SAS DATASET
  • SAS program
  • Programming language
  • Elements of the SAS laguage
  • Rules for SAS statements
  • Rules for MOST SAS names
  • Special rules for variable names
  • Types of variables
  • Data analysis and reporting utilities
  • Traditional output
  • Ways to SAS programs
  • SAS windowing environment
  • Non Interactive mode
  • Batch Mode
  • Interactive line mode
  • Running programs in the SAS windowing environment

Chapter 2: How SAS works

  • Writing your first SAS program
  • A simple program to read raw data and produce a record
  • Enhancing the program
  • More on comment statements
  • Internal processing in SAS
  • How SAS works
  • The compilation phase
  • The execution phase
  • Processing a data step: A Walkthrough
  • Creating the input buffer and the program generating vector
  • Writing an observation to the SAS data set
  • Four types of SAS Libraries
  • SAS libraries
  • Work libraries
  • SAS help library
  • SAS user library

Chapter 3: Reading raw data into SAS

  • What is RAW DATA
  • Definitions
  • Data values
  • Numeric value
  • Character value
  • Standard data
  • Non Standard data
  • Numeric data
  • Character data
  • Choosing an input style
  • List input
  • Modified list input
  • Column input
  • Formatted input
  • Named input
  • Instream data
  • Creating multiple records from single input row
  • Reading data from external files
  • Reading blank separated values (list or free form data):
  • Reading raw data separated by commas (.CSV Files):
  • Reading in raw data separated by tabs (.TXT Files):
  • Using informats with list inputs
  • Supplying an informat statement with list input
  • Using list input with embedded delimiters
  • Reading raw data that are aligned in columns
  • Method 1: Column input
  • Method 2: Formatted input
  • Using more than one input statement : The single statment
  • Reading column data that is on more than one line
  • Mixed-style input
  • In file options for special situations
  • Flowover
  • Missover
  • Truncover
  • PAD
  • Using LRECL to read very long lines of raw data
  • Checking you data after it has been read into SAS

Chapter 4: Reading data from a DATASET

  • Introduction
  • Set statement overview
  • Automatic variables in SAS
  • Interleave multiple SAS data sets
  • Combine multiple SAS data sets
  • Creationg and Modifying variables
  • Creating multiple datasets in a single data step
  • Subsetting observations
  • Conditional SAS statements
  • Logical and special operators
  • The SAS supervisor and the set statement
  • Efficiency and the set statement
  • Know your data
  • Set statement data set options
  • Drop and keep options
  • Rename option
  • Firstobs and OBS OPTIONS
  • IN option –
  • Where option –
  • Other SET statement options
  • END option
  • KEY option
  • NOBS option
  • POINT option
  • DO loops and the SET statements
  • Introduction to retain statement
  • Carry over values from one observation to another
  • Compare values across observations
  • Assign initial values
  • Detemining column order in output dataset
  • SAS system operations

Chapter 5: Reading data from a dataset

  • Input SAS data set for example
  • Selecting observations for a new SAS data set
  • Deleting observations based on a condition
  • Accepting observations based on a condition
  • Compsring the DELETE AND SUBSETTING IF statements
  • Methods of creating new data sets with a subset
  • Subsetting records from an external file with a subsetting IF statement
  • Subsetting observations in a Data step with a WHERE statement
  • Subsetting observations in a Proc Step with a WHERE statement
  • Subsetting observations in a PROC SQL
  • Difference between IF and WHERE

Chapter 6:SAS Informats and formats

  • Overview
  • Using SAS Informats
  • INPUT statements
  • INPUT function
  • INPUTN and INPUTC sunctions
  • ATTRIB and INFORMAT statments
  • Using SAS formats
  • Formate statement in procedures
  • PUT statement
  • PUT function
  • PUTN and PUTC functions
  • BESTw. format
  • Additional comments

Chapter 7: SAS functions

  • Categories of functions
  • SAS character functions
  • Functions that change the case of characters
  • UPCASE
  • LOWCASE
  • PROPCASE
  • Functions that remove characters from strings
  • Function: COMPBL
  • Function: COMPRESS
  • Functions that search for characters
  • Function: ANYALNUM
  • Function: ANYALPHA
  • Function: ANYDIGIT
  • Function: ANYPUNCT
  • Function: ANYSPACE
  • Function: NOTALNUM
  • Function: NOTALPHA
  • Function: NOTDIGIT
  • Function: NOTUPPER
  • Functions that search strings
  • FIND and FINDC
  • INDEX, INDEXC, and INDEXW
  • Functions to verify data
  • Function VERIFY
  • Functions that extract parts of strings
  • Function: SUBSTR (on the left hand side of the equal sign)
  • Function: SUBSTRN
  • Functions that join two or more strings to gather
  • Function: CAT
  • Function: CATS
  • Function: CATT
  • Function: CATX
  • Function that remove blanks from strings
  • Function: RIGHT
  • Function: TRIM
  • Function: TRIMN
  • Function: STRIP
  • Function that compare strings
  • Function: COMPARE
  • Function that divide strings into “WORDS”
  • Function: SCAN
  • Function: SCANQ
  • Functions that substitute letters or words in strings
  • Function: TRANSLATE
  • Function: TRANWRD
  • Functions that compute the length of string
  • Function: LENGTH
  • Function: LENGTHC
  • Function: LENGTHM
  • Function: LENGTHN
  • Functions that count the number of letters or substrings in a string
  • Function: COUNT
  • Function: COUNTC
  • Miscellaneous string functions
  • Function: MISSING
  • Function: REPEAT
  • Function: REVERSE
  • SAS DATE and TIME functions
  • Introduction
  • What is a SAS DATE and TIME literal?
  • DATE and TIME Functions
  • Functions to create DATE and TIME values
  • Function to TAKIE DATETIME values apart
  • Functions to get QUARTER ,YEAR or DAY of the date
  • Functions that work with INTERVALS
  • Using formats for DATE AND TIME
  • System options DATE and TIME

Chapter 8: An introduction to Arrays and Array processing

  • Why do we need ARRAYS?
  • Basic ARRAY concepts
  • ARRAY statement
  • ARRAY referances
  • Variable name ARRAY referance
  • Using ARRAY indexes
  • One dimension arrays
  • Multi-dimension arrays
  • Temporary arrays
  • Sorting arrays
  • Determining Array Bounds: LBOUND and HBOUND Functions
  • When to use ARRAYS
  • Common errors and misunderstands
  • Invalid index range
  • Function name as an array name
  • Array referenced in multiple data steps, but defined in only one

Chapter 9: By – group processing

  • DEFINITIONS FOR BY-GROUP PROCESSING
  • BY-GROUP PROCESSING
  • BY VALUE
  • BY GROUP
  • FIRST.VARIABLE AND LAST.VARIABLE
  • MODIFYING SAS DATA SETS: EXAMPLES.
  • INVOKING BY-GROUP PROCESSING
  • PREPROCESSING INPUT DATA FOR BY-GROUP PROCESSING
  • SORTING OBSERVATIONS FOR BY-GROUP PROCESSING
  • INDEXING FOR BY-GROUP PROCESSING
  • HOW THE DATA STEP IDENTIFIES BY GROUPS
  • PROCESSING OBSERVATIONS IN A BY GROUP
  • HOW SAS DETERMINES FIRST.VARIABLE AND LAST.VARIABLE
  • PROCESSING BY-GROUPS IN THE DATA STEP
  • OVERVIEW
  • PROCESSING BY-GROUPS CONDITIONALLY
  • DATA NOT IN ALPHABETIC OR NUMERIC ORDER
  • DATA GROUPED BY FORMATTED VALUES

Chapter 10: OVERVIEW OF METHODS FOR COMBINING SAS DATA SETS

  • DEFINITIONS
  • CONCATENATING
  • INTERLEAVING
  • ONE-TO- ONE READING OR ONE-TO-ONE MERGING
  • MATCH-MERGING
  • UPDATING
  • MODIFYING
  • DEFINITIONS FOR READING, COMBINING, AND MODIFYING SAS DATA SETS
  • READING A SAS DATA SET
  • COMBINING SAS DATA SETS
  • MODIFYING SAS DATA SETS
  • OVERVIEW OF TOOLS
  • READING SAS DATA SETS
  • READING A SINGLE SAS DATA SET
  • READING FROM MULTIPLE SAS DATA SETS
  • COMBINING SAS DATA SETS: BASIC CONCEPTS
  • ONE-TO-ONE
  • ONE-TO-MANY AND MANY-TO-ONE
  • MANY-TO-MANY
  • ACCESS METHODS: SEQUENTIAL VERSUS DIRECT
  • SEQUENTIAL ACCESS
  • DIRECT ACCESS
  • ONE-TO-ONE READING
  • DATA STEP PROCESSING DURING A ONE-TO-ONE READING
  • ONE-TO-ONE MERGING
  • MATCH-MERGING
  • UPDATING WITH THE UPDATE AND THE MODIFY STATEMENTS :
  • DEFINITIONS
  • SYNTAX OF THE UPDATE STATEMENT
  • SYNTAX OF THE MODIFY STATEMENT –
  • UPDATING WITH NONMATCHED OBSERVATIONS, MISSING VALUES, AND NEW VARIABLES –
  • USING AN INDEX WITH THE MODIFY STATEMENT

Chapter 11: SAS PROCEDURES

  • INTRODUCTION
  • THE ANATOMY OF A PROC
  • THE PROC STATEMENT
  • TITLE AND FOOTNOTE STATEMENTS
  • BY STATEMENT
  • LABEL STATEMENT
  • FORMAT STATEMENT
  • RUN OR QUIT STATEMENT
  • DESCRIPTION OF DATA USED IN REPORTS
  • SAS REPORTING PROCEDURES
  • PROCS FOR ALL THAT DETAIL
  • USING PROC PRINT
  • USING PROC SQL
  • PROC REPORT
  • PROCS THAT SUMMARIZE
  • USING PROC CHART
  • USING PROC FREQ
  • USING PROC MEANS
  • USING PROC UNIVARIATE
  • INTRODUCTION TO PROC TABULATE
  • DATA MANIPULATION AND MANAGEMENT PROCEDURE
  • PROC SORT
  • PROC DATASETS
  • PROC FORMAT
  • PROC CONTENTS
  • OTHER IMPORTANT PROCS
  • PROC TRANSPOSE
  • DEFINITIONS
  • PROC PRINTTO
  • COMPARE PROCEDURE
  • PROC APPEND
  • HOW TO IMPORT AN EXCEL FILE INTO SAS

Chapter 12: INTRODUCTION TO PROC SQL

  • INTRODUCTION
  • WHY LEARN PROC SQL?
  • SELECT STATEMENT
  • THE SELECT STATEMENT SYNTAX
  • A SIMPLE PROC SQL
  • A COMPLEX PROC SQL
  • LIMITING INFORMATION ON THE SELECT
  • CREATING NEW VARIABLES
  • THE CALCULATED OPTION ON THE SELECT
  • USING LABELS AND FORMATS
  • THE CASE EXPRESSION ON THE SELECT
  • ADDITIONAL SELECT STATEMENT CLAUSES
  • REMERGING
  • REMERGING FOR TOTALS
  • CALCULATING PERCENTAGE
  • SORTING THE DATA IN PROC SQL
  • SORT ON NEW COLUMN
  • SUBSETTING USING THE WHERE
  • INCORRECT WHERE CLAUSE
  • WHERE ON COMPUTED COLUMN
  • SELECTION ON GROUP COLUMN
  • USE HAVING CLAUSE
  • CREATING NEW TABLES
  • JOINING DATASETS USING PROC SQL
  • INNER JOIN
  • JOINING THREE OR MORE TABLES
  • OUTER JOINS
  • INCLUDING NONMATCHING ROWS WITH THE RIGHT OUTER JOIN
  • SELECTING ALL ROWS WITH THE FULL OUTER JOIN
  • CONCATENATING QUERY RESULTS

Chapter 13:AN INTRODUCTION TO SAS MACROS

  • INTRODUCTION
  • SAS MACRO OVERVIEW
  • TRADITIONAL SAS PROGRAMMING
  • THE SAS MACRO LANGUAGE
  • MACRO LANGUAGE COMPONENTS
  • MACRO VARIABLES
  • MACRO STATEMENTS
  • MACRO PROCESSOR FLOW
  • AUTOMATIC MACRO VARIABLES
  • MACRO DEBUGGING OPTIONS
  • WHAT IS A MACRO?
  • DEFINING AND USING MACROS
  • POSITIONAL MACRO PARAMETERS
  • KEYWORD MACRO PARAMETERS
  • CONDITIONAL MACRO COMPILATION
  • THE %DO STATEMENT
  • SAS DATA STEP INTERFACES

Chapter 14: THE OUTPUT DELIVERY SYSTEM (ODS)

  • INTRODUCTION
  • CREATING VARIOUS TYPES OF REPORTS LISTING OUTPUT
  • OTHER DESTINATIONS
  • HTML
  • PDF AND POSTSCRIPT
  • RTF FILES
  • MICROSOFT EXCEL
  • ADDING STYLE TO YOUR REPORTS
  • LOCATE EXISTING STYLES
  • ODS STYLE= OPTION
  • CUSTOMIZE YOUR REPORTS
  • ODS SELECT; AND ODS EXCLUDE;
  • OTHER CUSTOMIZATIONS
  • ODS PROCLABEL= ;
  • ODS PROCTITLE; AND ODS NOPROCTITLE;
  • ADVANCED TECHNIQUES
  • ODS DOCUMENT
  • PROC TEMPLATE

Chapter 15: INTRODUCTION TO DIAGNOSING AND AVOIDING ERRORS

  • INTRODUCTION
  • UNDERSTANDING HOW THE SAS SUPERVISOR CHECKS A JOB
  • UNDERSTANDING HOW SAS PROCESSES ERRORS
  • DISTINGUISHING TYPES OF ERRORS .SAS RECOGNIZES FOUR KINDS OF ERRORS:
  • SYNTAX ERRORS
  • EXECUTION-TIME ERRORS
  • DATA ERRORS
  • SEMANTIC ERRORS
  • DIAGNOSING ERRORS
  • DIAGNOSING SYNTAX ERRORS
  • DIAGNOSING DATA ERRORS
  • USING A QUALITY CONTROL CHECKLIST

Chapter 16: ADVANCE TOPICS IN SAS

  • PERFORMING ADVANCED QUERIES USING PROC SQL
  • INTRODUCING MACRO VARIABLES
  • CREATING AND USING MACRO PROGRAMS
  • STORING MACRO PROGRAMS
  • CREATING SAMPLES AND INDEXES
  • USING LOOKUP TABLES TO MATCH DATA
  • MODIFYING SAS DATA SETS AND TRACKING CHANGES
  • INTRODUCTION TO EFFICIENT SAS PROGRAMMING