Monday, October 18, 2010

The PAD option

When you read variable-length records that contain fixed-field data into a SAS data set, there might be values that are shorter than others or that are missing. The PAD option pads each record with blanks so that all data lines have the same length.

data new4;
    infile 'c:\myrawdata\infileoptions.txt' pad;
    input id $3.;
run;

We will get the following dataset:

Obs    id
   1     1
   2     22
   3     333
   4     444
   5     555

No comments:

Post a Comment