SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Raw Data in Fixed Fields
Column Input Review


You can use column input to read the values for Item, IDnum, InStock, and BackOrd from the raw data file referenced by the fileref Invent.

     input Item $ 1-13 IDnum $ 15-19 InStock 21-22 
           BackOrd 24-25;

Raw Data File Invent
1---+----10---+----20---+--
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  


Notice that the INPUT statement lists the variables with their corresponding column locations in order from left to right. However, one of the features of column input is the capability to read fields in any order.

For example, you could have read the values for InStock and BackOrd before the values for Item and IDnum.

     input InStock 21-22 BackOrd 24-25 Item $ 1-13 
           IDnum $ 15-19;

back||next


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

Terms of Use & Legal Information | Privacy Statement