DATA Step, Macro, Functions and more

difference between MISSOVER and TRUNCOVER options

Reply
N/A
Posts: 0

difference between MISSOVER and TRUNCOVER options

can anyone explain the difference between MISSOVER and TRUNCOVER options with example.Both produce same results i guess.In what way they both differ?
SAS Super FREQ
Posts: 8,862

Re: difference between MISSOVER and TRUNCOVER options

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: difference between MISSOVER and TRUNCOVER options

Posted in reply to Cynthia_sas
hi cynthia,
thanks for the help..can you give me the link of the mentioned online doc.
Super Contributor
Posts: 345

Re: difference between MISSOVER and TRUNCOVER options

Posted in reply to deleted_user
N/A
Posts: 0

Re: difference between MISSOVER and TRUNCOVER options

Posted in reply to andreas_lds
hey..thanks a lot..for giving the website...
SAS Employee
Posts: 6

Re: difference between MISSOVER and TRUNCOVER options

Posted in reply to deleted_user
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.
Ask a Question
Discussion stats
  • 5 replies
  • 2983 views
  • 0 likes
  • 4 in conversation