When importing raw text files (via DATA STEP and INFILE), it often happens that the lines do not all have the same length. By default, SAS© has a dangerous behavior: if it cannot read a variable completely, it jumps to the next line to continue (the FLOWOVER option).
To prevent this, two options exist: MISSOVER and TRUNCOVER. Many people think they are interchangeable. However, there is a critical difference that can skew your data.
1. The Crash Scenario
Imagine asking SAS© to read 5 characters starting from position 18.
INPUT @articles_translated/article_18_en.json code $5.;
But, your data line is shorter than expected: it stops at position 20.
SAS© needs positions: 18, 19, 20, 21, 22.
The file contains: 18, 19, 20 (end of line).
So, 2 characters are missing to satisfy the request. This is where the choice of option changes everything.
2. MISSOVER: "All or Nothing"
The MISSOVER (Missing Over) option is strict.
If SAS© does not find all of the characters required by the format, it considers the read impossible for that variable.
Behavior: "You promised me 5 characters, but I only see 3. I'm taking nothing."
Result: The variable is set to missing.
Risk: You lose the partial information present at the end of the line (characters 18, 19, and 20 are ignored).
3. TRUNCOVER: "Take What's There"
The TRUNCOVER (Truncated Over) option is flexible.
If the line ends before the format is complete, SAS© retrieves whatever it finds up to the line break.
Behavior: "I wanted 5 characters, but you only have 3? No problem, give me the 3."
Result: The variable contains the partial value (the characters at positions 18-20).
Advantage: No data is lost.
4. Comparative Example
SAS© Code:
