CSULB_STAT475_handout3

CSULB_STAT475_handout3 - STAT 475 Chapters 5 17 CREATING...

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

View Full Document Right Arrow Icon
STAT 475 Chapters 5, 17 CREATING SAS DATA SETS: Advanced Options There are several important options that may be used when creating a data set. (1) When data are inputted in columns (called column input ), then in INPUT statement, besides variable names and types (character or numeric), it is wise to specify ranges (starting column and ending column) for each variable. For example, to describe the variables in the data set 1–––+–––– 10 ––– type input ID $ 1-4 Age 6-7 ActLevel $ 9-12 Sex $ 14; This implies that variable ID occupies columns 1 through 4; Age , columns 6 through 7; ActLevel , columns 9 through 12; and Sex occupies column 14. Note that the line on top of the data set (called a ruler ) is used for identifying individual columns. It is not part of the dataset, and is added conventionally to raw data in examples. Note that when using column input, it is not necessary to specify variables in the order of appearance. The following INPUT statement is acceptable input ActLevel $ 9-12 Age 6-7 ID $ 1-4 Sex $ 14; SAS reads these variables in the order ActLevel , Age , ID , Sex . Note that the column range must be placed after the dollar sign, if it exists. For example, typing input ID 1-4 $ Age 6-7 ActLevel 9-12 $ Sex 14 $ ; produces an error message, and is not understood by SAS. 1 2810 61 MOD F 2804 38 HIGH F 2807 42 LOW M 2816 26 HIGH M 2833 32 MOD F 2823 29 HIGH M
Background image of page 1

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

View Full DocumentRight Arrow Icon
Note that it is not necessary to give the column range for all variables listed in the INPUT statements. For example, input ID $ Age 6-7 ActLevel $ 9-12 Sex $; reads the data correctly (verify!) Example. Column input is especially useful when a numeric variable contains a special character, for example, a dollar sign. The following DATA step reads the variable payment as a numeric variable ignoring the dollar sign.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2011 for the course STAT 475 taught by Professor Olgak during the Fall '11 term at CSU Long Beach.

Page1 / 7

CSULB_STAT475_handout3 - STAT 475 Chapters 5 17 CREATING...

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

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