Reading Raw Data in Fixed Fields |
Record
Formats |
Reading Variable Length Records
When you are working with variable-length records that contain fixed-field data, you may have values that are shorter than others or that are missing.This can cause problems when you attempt to read the raw data into your SAS data set. For example, notice that the INPUT statement specifies a field width
of 8 columns for |
input Department $ 1-11 @13 TotalReceipts comma8.; |
The asterisk symbolizes the end-of-record marker and is not part of the data. |
12345678 | ||||||||
|
The input pointer moves down to the next record in an
attempt to find a value for TotalReceipts . However, Grill
is a character value and TotalReceipts is a numeric variable.
Thus, an invalid data error occurs and TotalReceipts is
set to missing. |
BED/BATH 1,354.93* |
HOUSEWARES 2,464.05* |
GARDEN 923.34* |
GRILL 598.34* |
SHOES 1,345.82* |
SPORTS* |
TOYS 6,536.53* |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.