- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I was using cards.Thank you! it is really helpful. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks all!! i always wondered how to see the difference.I completely understand now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank all for your valuable insights and letting me understand the difference between Missover and Truncover.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Tags:
- spam
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
hi sir