DATA Step, Macro, Functions and more

What is the difference between Missover and Truncover?

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

What is the difference between Missover and Truncover?

Hi Guys,

I am new to SAS. I am not able to find any difference between Missover and Truncover.

I have used following example to figure out the difference, but could not found any difference.

DATA test;

INFILE datalines missover;

input lname $ fname $ job $ jobn $;

DATALINES;

LANGKAMM            SARAH     E0045 Mechanic

TORRES                JAN            E0029 Pilot

SMITH               MICHAEL   E0065

LEISTNER            COLIN     E0116 Mechanic

TOMAS               HARALD

WADE                KIRSTEN   E0126 Pilot

WAUGH               TIM       E0204 Pilot

;

run;

May be, I have selected wrong example to find the difference. Please help me out to find the difference between the two.

Thanks in advance,

John


Accepted Solutions
Solution
‎07-15-2011 08:54 AM
PROC Star
Posts: 7,471

What is the difference between Missover and Truncover?

[ Edited ]

Although it is subtle, the difference is there:

 

Use notepad to save the following lines as a text file labeled emplist.txt:

 

LANGKAMM SARAH E0045 Mechanic
TORRES JAN E0029 Pilot
SMITH MICHAEL E0065
LEISTNER COLIN E0116 Mechanic
TOMAS HARALD
WADE KIRSTEN E0126 Pilot
WAUGH TIM E0204 Pilot
 

  

then run the following:

 

DATA test1;
  INFILE "/folders/myfolders/emplist.txt" missover;
  INPUT lastn $1-21 Firstn $ 22-31
   Empid $32-36 Jobcode $37-45;
RUN;

DATA test2;
  INFILE "/folders/myfolders/emplist.txt" truncover;
  INPUT lastn $1-21 Firstn $ 22-31
   Empid $32-36 Jobcode $37-45;
RUN;

 

You can find an explanation in the paper at:

http://www2.sas.com/proceedings/sugi26/p009-26.pdf

 

HTH,

Art

 

Editor's Note: See also this topic in SAS documentation about MISSOVER, TRUNCOVER, STOPOVER and FLOWOVER.

 

And this explanation from @Tom

The difference is what it does when there are not enough characters for the input that you requested.
An easy test is to read in a text file using this input statement.    
input line $80. ;  



With missover you will get a missing value if the line does not have at least 80 characters (counting trailing spaces). With truncover you get the first 80 characters of the line, even for short lines.   Your example works the same with MISSOVER and FLOWOVER because you did not specify a specific number of characters to read in your INPUT statement.

 

View solution in original post


All Replies
Solution
‎07-15-2011 08:54 AM
PROC Star
Posts: 7,471

What is the difference between Missover and Truncover?

[ Edited ]

Although it is subtle, the difference is there:

 

Use notepad to save the following lines as a text file labeled emplist.txt:

 

LANGKAMM SARAH E0045 Mechanic
TORRES JAN E0029 Pilot
SMITH MICHAEL E0065
LEISTNER COLIN E0116 Mechanic
TOMAS HARALD
WADE KIRSTEN E0126 Pilot
WAUGH TIM E0204 Pilot
 

  

then run the following:

 

DATA test1;
  INFILE "/folders/myfolders/emplist.txt" missover;
  INPUT lastn $1-21 Firstn $ 22-31
   Empid $32-36 Jobcode $37-45;
RUN;

DATA test2;
  INFILE "/folders/myfolders/emplist.txt" truncover;
  INPUT lastn $1-21 Firstn $ 22-31
   Empid $32-36 Jobcode $37-45;
RUN;

 

You can find an explanation in the paper at:

http://www2.sas.com/proceedings/sugi26/p009-26.pdf

 

HTH,

Art

 

Editor's Note: See also this topic in SAS documentation about MISSOVER, TRUNCOVER, STOPOVER and FLOWOVER.

 

And this explanation from @Tom

The difference is what it does when there are not enough characters for the input that you requested.
An easy test is to read in a text file using this input statement.    
input line $80. ;  



With missover you will get a missing value if the line does not have at least 80 characters (counting trailing spaces). With truncover you get the first 80 characters of the line, even for short lines.   Your example works the same with MISSOVER and FLOWOVER because you did not specify a specific number of characters to read in your INPUT statement.

 

Established User
Posts: 1

Re: What is the difference between Missover and Truncover?

In case missing values in between observation then what should we do? actualy missover is reading only last column missing values.

Can you help me out????

 

 

 

 

Thanks in advance

SAS Super FREQ
Posts: 8,864

What is the difference between Missover and Truncover?

Hi:

  I've always thought this documentation topic was very good:

http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002645812.htm

  It is hard to understand MISSOVER and TRUNCOVER without understanding the default behavior FLOWOVER and this topic also discusses STOPOVER.

cynthia

Occasional Contributor
Posts: 16

Re: What is the difference between Missover and Truncover?

Posted in reply to Cynthia_sas

Cynthia,

 

Thank you very much for your recommendation to review the link to the article that shows differences between TRUNCOVER and MISSOVER. The examples provided hit home the key differences.

 

Many thanks,

 

Murali Sastry

Super User
Super User
Posts: 7,042

What is the difference between Missover and Truncover?

The difference is what it does when there are not enough characters for the input that you requested.

An easy test is to read in a text file using this input statement.

  input line $80. ;

With missover you will get a missing value if the line does not have at least 80 characters (counting trailing spaces).

With truncover you get the first 80 characters of the line, even for short lines.

Your example works the same with MISSOVER and FLOWOVER because you did not sepecify a specific number of characters to read in your INPUT statement.

Super User
Posts: 10,023

What is the difference between Missover and Truncover?

Just as Art.T said ,the most difference is for column input. And Art.T have a good example.

missover is old product, and truncover is new product, So recommend you to use truncover.

As far as I know pad+missover = truncover

Ksharp

Frequent Contributor
Posts: 139

What is the difference between Missover and Truncover?

Thanks all!! i always wondered how to see the difference.I completely understand now.

Contributor
Posts: 35

What is the difference between Missover and Truncover?

Thank all for your valuable insights and letting me understand the difference between Missover and Truncover.

Valued Guide
Posts: 765

What is the difference between Missover and Truncover?

Hi ... this is a paper that does a very good job explaining various options such as MISSOVER, TRUNCOVER, etc.

MISSOVER, TRUNCOVER, and PAD, OH MY!!

or Making Sense of the INFILE and INPUT Statements.

http://www.nesug.org/proceedings/nesug01/at/at1sa1.pdf

N/A
Posts: 1

Re: What is the difference between Missover and Truncover?

hi sir

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 39544 views
  • 4 likes
  • 10 in conversation