SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
deleted_user
Not applicable
can anyone explain the difference between MISSOVER and TRUNCOVER options with example.Both produce same results i guess.In what way they both differ?
5 REPLIES 5
Cynthia_sas
SAS Super FREQ
Hi:
In the documentation, there is a topic:
"Starting with Raw Data: Beyond the Basics"
and in that topic is a sub-topic:
"Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values"

That section of the doc has very thorough examples of MISSOVER, TRUNCOVER, FLOWOVER and STOPOVER. With data and code....

I recommend this section. If you search for the string "TRUNCOVER" in the on-line doc, you should find the "Starting with Raw Data" topic and can follow links from there.

cynthia
deleted_user
Not applicable
hi cynthia,
thanks for the help..can you give me the link of the mentioned online doc.
deleted_user
Not applicable
hey..thanks a lot..for giving the website...
WarrenR_SAS
SAS Employee
The main difference between MISSOVER and TRUNCOVER occurs when you have variable length records and are using formatted or column input. TRUNCOVER reads "partial" data that falls at the end of the record, whereas MISSOVER sets the value to missing.

An example to further clarify: An INPUT statement requests to read exactly 5 bytes starting at position 18, but a data record is only 20 bytes long. TRUNCOVER will treat bytes 18-20 as valid data. MISSOVER sees that bytes 21 and 22 are not present and considers the field to be invalid. If the record had been 17 bytes long, both TRUNCOVER and MISSOVER would produce a missing value.

Variable length records were pretty rare in the early mainframe days of SAS, but they are nearly universal in Windows and Unix-family systems. As a general rule, TRUNCOVER should be used in most modern SAS applications.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 13230 views
  • 0 likes
  • 4 in conversation