Ii rep ii rep i rep i rep iv rep ii rep ii rep iv rep

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: on Irenie Christina Kimiko Lucian Fong Satyakam Sharryn Monica Alvin Kevin 1 2 3 4 5 6 7 8 9 10 11 12 Compilation data work.subset3; length First_Name $ 12 Last_Name $ 18 Gender $ 1 Job_Title $ 25 Country $ 2; infile 'sales.csv' dlm=','; input Employee_ID First_Name $ Last_Name $ Gender $ Salary Job_Title $ Country $; run; First _Name $ 12 First_ Name Obs data work.subset3; length First_Name $ 12 Last_Name $ 18 Gender $ 1 Job_Title $ 25 Country $ 2; infile 'sales.csv' dlm=','; input Employee_ID First_Name $ Last_Name $ Gender $ Salary Job_Title $ Country $; run; PDV Last _Name $ 18 Gender $1 Job_Title $ 25 First _Name $ 12 Country $2 ... Last _Name $ 18 Gender $1 Job_Title $ 25 Country $2 Employee _ID N8 Salary N8 48 8 Objectives Chapter 7: Reading Delimited Raw Data Files Use informats to read nonstandard data. Add additional SAS statements to perform further processing in the DATA step. Use the DSD option with list input to read consecutive delimiters as missing values. Use the MISSOVER option to recognize missing values at the end of a record (Self-Study). 7.1 Using Standard Delimited Data as Input 7.2 Using Nonstandard Delimited Data as Input 50 49 Standard and Nonstandard Data List Input for Nonstandard Data Standard data is data that SAS can read without any special instructions. Examples of standard numeric data: 58 -23 67.23 00.99 5.67E5 List input specification: INPUT variable <$> variable < :informat >; 1.2E-2 The : format modifier enables you to use an informat to read nonstandard delimited data. An informat is an instruction that SAS uses to read data values into a variable. The width of the informat can be eliminated. For character variables, the width of the informat determines the variable length, if it has not been previously defined. Nonstandard data is any data that SAS cannot read without a special instruction. Examples of nonstandard numeric data: 5,823 (23) $67.23 01/12/1999 12MAY2006 51 52 52 SAS Informats SAS Informats SAS informats have the following form: Selected SAS Informats: Informat <$>informat<w>.<d> Definition $w. $ informat specifies the number of columns to read in the input data. . is a required delimiter. d reads standard numeric data. COMMAw.d DOLLARw.d names the SAS informat or user-defined informat. w 53 w.d indicates a character informat. reads standard character data. specifies an optional decimal scaling factor in the numeric informats. reads nonstandard numeric data and removes embedded commas, blanks, dollar signs, percent signs, and dashes. COMMAXw.d reads nonstandard numeric data and removes embedded periods, blanks, dollar signs, percent signs, DOLLARXw.d and dashes. EUROXw.d reads nonstandard numeric data and removes embedded characters in European currency. 54 9 SAS Informats SAS Informats In list input, informats are used to convert nonstandard numeric data to SAS numeric values. SAS uses date informats to read and convert dates to SAS date values. Informat Raw Data Value SAS Data Value COMMA. DOLLAR. $12,345 12345 COM...
View Full Document

Ask a homework question - tutors are online