Lecture8 - Chapter 14: Controlling Input and Output 14.1...

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

View Full Document Right Arrow Icon
1 Chapter 14: Controlling Input and Output 14.1 Outputting Multiple Observations 14.2 Writing to Multiple SAS Data Sets 14.3 Selecting Variables and Observations
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Chapter 14: Controlling Input and Output 14.1 Outputting Multiple Observations 14.2 Writing to Multiple SAS Data Sets 14.3 Selecting Variables and Observations
Background image of page 2
3 Objectives Explicitly control the output of multiple observations to a SAS data set.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Business Scenario A Forecasting Application The growth rate of six departments at Orion Star is stored in the Increase variable in the data set orion.growth . If each department grows at its predicted rate for the next two years, how many employees will be in each department at the end of each year? Listing of orion.growth Total_ Department Employees Increase Administration 34 0.25 Engineering 9 0.30 IS 25 0.10 Marketing 20 0.20 Sales 201 0.30 Sales Management 11 0.10
Background image of page 4
5 A Forecasting Application The output SAS data set, forecast , should contain 12 observations. Two observations are written for each observation read. Partial Listing of forecast Total_ Department Employees Increase Year Administration 42.500 0.25 1 Administration 53.125 0.25 2 Engineering 11.700 0.30 1 Engineering 15.210 0.30 2 IS 27.500 0.10 1 IS 30.250 0.10 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Quiz Which of the following occur at the end of a DATA step iteration? a. Reinitialize the PDV. b. Implicit output; implicit return. c. Read the next observation. data forecast; set orion.growth; total_employees= total_employees * (1+increase); run; ?
Background image of page 6
7 Quiz Correct Answer Which of the following occur at the end of a DATA step iteration? By default, every DATA step performs an implicit OUTPUT and implicit RETURN at the end of each iteration. data forecast; set orion.growth; total_employees= total_employees * (1+increase); run; Implicit OUTPUT; Implicit RETURN;
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Explicit Output The explicit OUTPUT statement writes the contents of the program data vector (PDV) to the data set or data sets being created. The presence of an explicit OUTPUT statement overrides implicit output. data forecast; set orion.growth; Year=1; Total_Employees=Total_Employees*(1+Increase); Year=2; Total_Employees=Total_Employees*(1+Increase); run; No Implicit OUTPUT;
Background image of page 8
9 Compilation data forecast; Year=1; Total_Employees=Total_Employees*(1+Increase); output; Year=2; Total_Employees=Total_Employees*(1+Increase); output; run; PDV – Program Data Vector Department $ 20 Total_ Employees N 8 Increase N 8 ...
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Compilation PDV Department $ 20 Total_ Employees N 8 Increase N 8 Year N 8 data forecast; set orion.growth; Total_Employees=Total_Employees*(1+Increase); output; Year=2; Total_Employees=Total_Employees*(1+Increase); output; run; ...
Background image of page 10
11 Compilation data forecast; set orion.growth; Year=1; Total_Employees=Total_Employees*(1+Increase); output; Year=2; Total_Employees=Total_Employees*(1+Increase); output; PDV Department $ 20 Total_ Employees N 8 Increase N 8 Year N 8 ...
Background image of page 11

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

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

This note was uploaded on 06/12/2011 for the course ASB 1001,2522, taught by Professor Nicole during the One '09 term at University of New South Wales.

Page1 / 166

Lecture8 - Chapter 14: Controlling Input and Output 14.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