prg1c03 - 1 Chapter 3: Working with SAS Syntax 3.1...

Info iconThis preview shows pages 1–10. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Chapter 3: Working with SAS Syntax 3.1 Mastering Fundamental Concepts 3.2 Diagnosing and Correcting Syntax Errors 2 Chapter 3: Working with SAS Syntax 3.1 Mastering Fundamental Concepts 3.1 Mastering Fundamental Concepts 3.2 Diagnosing and Correcting Syntax Errors 3 Objectives Identify the characteristics of SAS statements. Explain SAS syntax rules. Insert SAS comments using two methods. 3 4 SAS Programs A SAS program is a sequence of steps. A step is a sequence of SAS statements. 4 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 5 Statements SAS statements have these characteristics: usually begin with an identifying keyword always end with a semicolon 5 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; p103d01 6 7 3.01 Quiz How many statements are in the DATA step? a. 1 b. 3 c. 5 d. 7 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; 8 3.01 Quiz Correct Answer How many statements are in the DATA step? a. 1 b. 3 c. 5 d. 7 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; 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; 9 SAS Syntax Rules Structured, consistent spacing makes a SAS program easier to read. 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; Conventional Formatting 10...
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 University-West Lafayette.

Page1 / 33

prg1c03 - 1 Chapter 3: Working with SAS Syntax 3.1...

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

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