Using MISSOVER for reading records of different length

If you are reading a file that has records of different length and has missing values at the end of a record, use the MISSOVER option.

For example, if you have a file that has 4 variables in it, but several records are missing the fourth variable:

1246  22 58 66
1299  29 62 80
1345  31 77
1388  42 51 92
1402     67 

The following program will read these data correctly:

data a;
infile 'test.dat' MISSOVER;
input v1 1-4  v2 7-8  v3 10-10  v4 12-12;
proc print;
var v1 v2 v3 v4;
run;

Without the MISSOVER option, SAS will go to the next line any time the fourth variable is missing:

NOTE: LOST CARD.
V1=1402 V2=. V3=67 V4=. _ERROR_=1 _N_=4
NOTE: 5 records were read from the infile 'missover.dat'.
      The minimum record length was 11.
      The maximum record length was 14.
NOTE: SAS went to a new line when INPUT statement reached past the end of
a line.

NEW PSC blog

Recent resources, events, news

New Publications

Knodel et al. "Gendered Housework in Vietnam." PSC Research Report.

Couper. Designing Effective Web Surveys

Next Brown Bag

Monday, Oct 13
Jamie Jones
"Fertility & Risk Aversion on Utah Frontier"


W A R N I N G

If you are reading this, it may be that you are using rather old web browsing software that does not support modern international Web technology standards. For a better experience of the Web and this site in particular, please upgrade your web browser software today. The following are good choices: Firefox 2; Opera 9; Safari 3.