Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
146 views

Summary SAS Programming Essentials PDF

This document provides an overview of SAS programming for essentials. It discusses accessing and exploring data using PROC steps and libraries to analyze continuous and categorical variables. It also covers preparing data using data steps to read in data and create new variables using functions, and conditional processing using IF-THEN-ELSE statements. The document concludes with analyzing and reporting on data using PROC steps to create titles and labels and export results using data steps or PROC steps to Excel.

Uploaded by

Anna E
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views

Summary SAS Programming Essentials PDF

This document provides an overview of SAS programming for essentials. It discusses accessing and exploring data using PROC steps and libraries to analyze continuous and categorical variables. It also covers preparing data using data steps to read in data and create new variables using functions, and conditional processing using IF-THEN-ELSE statements. The document concludes with analyzing and reporting on data using PROC steps to create titles and labels and export results using data steps or PROC steps to Excel.

Uploaded by

Anna E
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Summary: SAS programming 1: Essentials

1. Essentials
2. Accessing Data
a. Accessing data through libraries

1
3. Exploring and validating data : PROC steps
1. Procedures

Continuous variables: Means, Univariate


Categorical variables: FREQ

2. Filtering rows “where expression…;”


Remark: use of SAS macro variables

3. Formatting values “format var name format.;”

4. Proc Sort

2
4. Preparing data: Data Step

1. Reading data

Remark: use of Format in Data step.

3
2. New variables
- Use of SAS functions

- Numeric functions
- Character functions
- Date functions

4
3. Conditional processing IF…. THEN….. ELSE…..

- In the IF : compound conditions are OK


- In the THEN: only 1 statement
- If you need more statements: use IF…. THEN DO……

5
5. Analyzing and reporting on data : Procedure

- Create titles, footnotes and labels


- Remark: labels in Proc step compared to labels in Data step.
- Categorical variables: Proc FREQ;
- Continuous variables: Proc MEANS; (use of CLASS statement)

6. Exporting results : Data step or Proc step


- To Excel

- Use ODS excel to export reports to multiple worksheets in Excel workbook

Remark: Be sure to close the ODS location at the end of the program! (ODS excel cose;)

6
7. Using SQL in SAS

 Create: Create a SAS data set


 Select: Select the columns
 From: data set (table) from which you read data
 Where: Filter rows
 ORDER BY: sorting the output

7
Questions

1.

Remark:

1. SAS accepts underscore in the names of variables


2. The problem here is that in the keep statement of the 2nd program, you have to keep
Pressure_Group (with underscore) and not PressureGroup (without underscore).

You might also like