BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
john83
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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

13 REPLIES 13
art297
Opal | Level 21

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.

 

Purnendu
Calcite | Level 5

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

nirupama1
Fluorite | Level 6

Hi ,

 

I used your code which have the positions specified , still I am getting the same result.

I understand the concept of missover and truncover but on practically doing I am not gettng any difference in output.

Both Missover and Truncover are behaving as Truncover.

Honestly, I tried a lot.

 

Can you please provide an example  showing difference in output between these two-missover and truncover.

Will be glad !

 

Thanks,

Nirupama

 

Tom
Super User Tom
Super User

@nirupama1 wrote:

Hi ,

 

I used your code which have the positions specified , still I am getting the same result.

I understand the concept of missover and truncover but on practically doing I am not gettng any difference in output.

Both Missover and Truncover are behaving as Truncover.

Honestly, I tried a lot.

 

Can you please provide an example  showing difference in output between these two-missover and truncover.

Will be glad !

 

Thanks,

Nirupama

 


Make sure to test using actual files and not in-line data (DATALINES or CARDS statement). SAS will pad in-line data with spaces to a length that is a multiple of 80 characters.

If you still have questions then post the code you tried as a new question.

nirupama1
Fluorite | Level 6

Yes, I was using cards.Thank you! it is really helpful. 🙂

Cynthia_sas
SAS Super FREQ

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

Murali11
Obsidian | Level 7

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

Tom
Super User Tom
Super User

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.

Ksharp
Super User

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

manojinpec
Obsidian | Level 7

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

john83
Calcite | Level 5

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

MikeZdeb
Rhodochrosite | Level 12

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 85792 views
  • 8 likes
  • 11 in conversation