How to Read Delimited Text Files into SAS
This sample program shows you how to read a delimited text file into SAS. A text file is often referred as raw data that can be prepared in a variety of formats (e.g., csv [comma-separated values], tab-delimited, or spacedelimited). When reading text files with the DATA step, two statements are used: INFILE and INPUT statements. The INFILE statement is used to specify the physical file being read. You can use a FILENAME statement in conjunction with an INFILE statement (see Example.1). Or, you can specify the full path to the file in the INFILE statement (see example.2). A set of options are available in the INFILE statement: DLM, DSD, and LRECL. The DLM option allows you to tell SAS what character is used as the delimiter in the text file. If this option is not specified, SAS assumes the delimiter is a space. Common delimiters include commas, vertical pipes, semi-colons, and tabs. The DSD option has three functions when reading delimited files. The first function is to remove any quot...