prg1c02 - 1 Chapter 2: Getting Started with SAS 2.1...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Chapter 2: Getting Started with SAS 2.1 Introduction to SAS Programs 2.2 Submitting a SAS Program 2 Chapter 2: Getting Started with SAS 2.1 Introduction to SAS Programs 2.1 Introduction to SAS Programs 2.2 Submitting a SAS Program 3 Objectives List the components of a SAS program. State the modes in which you can run a SAS program. 3 4 SAS Programs 4 DATA steps are typically used to create SAS data sets. PROC steps are typically used to process SAS data sets (that is, generate reports and graphs, manage data, and sort data). A SAS program is a sequence of steps that the user submits for execution. Raw Data Raw Data DATA Step DATA Step Report Report SAS Data Set PROC Step PROC Step SAS Data Set 5 6 2.01 Quiz How many steps are in this program? 6 data work.NewSalesEmps; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile 'newemps.csv' dlm=','; input First_Name $ Last_Name $ Job_Title $ Salary; run; proc print data=work.NewSalesEmps; run; proc means data=work.NewSalesEmps; class Job_Title; var Salary; run; p102d01 7 2.01 Quiz – Correct Answer How many steps are in this program? 3 steps 7 data work.NewSalesEmps; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile 'newemps.csv' dlm=','; input First_Name $ Last_Name $ Job_Title $ Salary; run; proc print data=work.NewSalesEmps; run; proc means data=work.NewSalesEmps; class Job_Title; var Salary; run; DATA Step PROC Step PROC Step p102d01 8 SAS Program Example This DATA step creates a temporary SAS data set named Work.NewSalesEmps by reading four fields from a raw data file. 8 data work.NewSalesEmps; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile 'newemps.csv' dlm=','; input First_Name $ Last_Name $ Job_Title $ Salary; run; proc print data=work.NewSalesEmps; run; proc means data=work.NewSalesEmps; class Job_Title; var Salary; run; 9 SAS Program Example This PROC PRINT step creates a listing report of the Work.NewSalesEmps data set. 9 data work.NewSalesEmps; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile 'newemps.csv' dlm=','; input First_Name $ Last_Name $ Job_Title $ Salary; run; proc print data=work.NewSalesEmps; run; proc means data=work.NewSalesEmps; class Job_Title; var Salary; run; 10 SAS Program Example This PROC MEANS step creates a summary report of the Work.NewSalesEmps data set with statistics for the variable Salary for each value of Job_Title . 10 data work.NewSalesEmps; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile 'newemps.csv' dlm=','; input First_Name $ Last_Name $ Job_Title $ Salary; run; proc print data=work.NewSalesEmps; run; proc means data=work.NewSalesEmps; class Job_Title; var Salary; run; 11 Step Boundaries 11 SAS steps begin with either of the following:...
View Full Document

This note was uploaded on 02/20/2012 for the course STAT 506 taught by Professor Staff during the Fall '08 term at Purdue.

Page1 / 41

prg1c02 - 1 Chapter 2: Getting Started with SAS 2.1...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online