SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Search||next

Reading Free-Format Data
Lesson Overview


Introduction

Raw data can be organized in several different ways.

This external file contains data that is arranged in columns, or fixed fields. You can specify a beginning and ending column for each field.


1---+----10---+----20---+----30--
BIRD FEEDER    LG088   3  20     
GLASS MUGS     SB082   6  12     
GLASS TRAY     BQ049  12   6     
PADDED HANGRS  MN256  15  20     
JEWELRY BOX    AJ498  23   0     
RED APRON      AQ072   9  12     
CRYSTAL VASE   AQ672  27   0     
PICNIC BASKET  LS930  21   0     


However, the following external file contains data that is free-format, meaning data that is not arranged in columns. Notice that the values for a particular field do not begin and end in the same columns.


1---+----10---+----20---+----30--
ABRAMS L.MARKETING $18,209.03    
BARCLAY M.MARKETING $18,435.71   
COURTNEY W.MARKETING $20,006.16  
FARLEY J.PUBLICATIONS $21,305.89 
HEINS W.PUBLICATIONS $20,539.23  


How your data is organized determines which input style you should use to read the data. SAS software provides three primary input styles: column, formatted, and list input. This lesson teaches you how to use list input to read free-format data that is not arranged in fixed fields.

This lesson contains 31 pages and takes approximately 45-60 minutes to complete.

Objectives

In this lesson, you learn to use the INPUT statement with list input to read

  • free-format data, or data that is not organized in fixed fields
  • free-format data separated by nonblank delimiters, such as commas
  • free-format data that contains missing values
  • character values that exceed eight characters
  • nonstandard free-format data
  • character values that contain embedded blanks.

In addition, you learn how to mix column, formatted, and list input styles in a single INPUT statement.


Prerequisites

Before taking this lesson, you should have completed the following lessons

Getting Started with SAS Programming
Creating SAS Data Sets
Reading Various Types of Raw Data

||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement