CSULB_STAT475_handout4

CSULB_STAT475_handout4 - STAT 475 Chapters 7, 17 SAS...

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

View Full Document Right Arrow Icon
STAT 475 Chapters 7, 17 SAS INFORMATS AND FORMATS SAS INFORMATS Informats are used to read data from external files, assigning permanent formats to variables. Typically, SAS informats are grouped into three categories: numeric, character, and date/time. For now, we study only numeric and character informats. The syntax of informats is as follows: Numeric variable INFORMATw.d Character variable $INFORMATw. The dollar sign indicates that it is a character type informat. INFORMAT refers to informat name (optional). The w refers to the width (the number of columns) of the variable (called a field width ). The d is used for numeric type data to specifiy the number of digits to the right of the decimal place. Informats must contain a period (called a period delimiter ) to differentiate informats from variable names. SAS provides a large number of informats. A complete list may be found in SAS documentation. Some example of informats are Numeric variable w.d COMMAw.d PERCENTw.d Character variable $w. $CHARw. The numeric informat COMMAw.d instructs SAS to treat the variable as numeric and strip the values from all comma separators (and dollar signs, if there are any). 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
The numeric informat PERCENTw.d instructs SAS to treat the variable with a percent sign (%) at the end as numeric and divide it by 100. The character informat $CHARw. instructs SAS to treat the variable as character and to store the variable with leading blanks, if they exist. Example. Suppose the following data are stored in file ‘H:\bankdata.dat’. The SAS code data bankdata; infile 'G:\STAT475F11\bankdata.dat '; input @ 1 ID $char3. @ 5
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_handout4 - STAT 475 Chapters 7, 17 SAS...

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