Home > Data Services > Catalog . Restricted Data . Census . ACS

Search Data Services

Meta Search
search across all the following databases:

Data Catalog
Data and documentation

KnowledgeBase
Common questions and answers.

Resources
Entire collection of data resources.


Latest Data News

RSS Feed icon

Sage Stats and CQ Political Stats Trial

Breaking News: Protect the 2020 Census

The Fastest Growing US Cities Are Mostly In the West

Another rule from NIH: Demographers might get to ignore this one

Research on Health Disparities: Incarceration Matters

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.