BookmarkSubscribeRSS Feed
ll12306
Calcite | Level 5

Why below two data sets have different outcome? (only difference is different type delimiter)

I'm thinking if hght_ft in first pic stop reading at blank and read what left for crown_ft, outcome for crown_ft should be a period since it's miising. (same as pic2) But, indeed, it reads next line for crown_ft. Why this happens??Screen Shot 2019-10-16 at 1.49.10 PM.pngScreen Shot 2019-10-16 at 1.50.05 PM.png

 

3 REPLIES 3
Reeza
Super User
Look into the defaults on the INFILE statement, specfically flowover, truncover etc.

The default is not what you want in this case (and most cases). If you specify TRUNCOVER in your INFILE statement after DSD it will fix the issue.
ballardw
Super User

Please post code and/or Log results into a code box opened on the forum using the {I} or "running man" icon. It should be easier than creating pictures, i.e. copy from the editor, open the window by clicking on the icon in the forum and pasting. The code boxes will also retain text formatting that is removed by the main message windows.

 

With code we can copy and paste with suggested changes or just highlight elements in responses, neither of which we can do with pictures.

 

If you try to read 4 variables, number on the INPUT statement and only 3 are present then SAS is trying to satisfy your instruction to read 4. So it goes to the next line unless told otherwise. Some of the options involved could be MISSOVER TRUNCOVER or STOPOVER FLOWOVER that implement slightly different rules for what do to do when running out of data. The default behavior is FLOWOVER, which will attempt to read from the next line.

 

Also when using simple list input as your Trees data set does the column alignment makes no difference: the values are read left to right.

For example with this code:

data junk;
   input x y z;
datalines;
1 2 .
  3 .
4 5 6
;

I might be attempting to read X as missing and Y as 3 from the second row but the first value encountered will be read as the first variable on the INPUT statement so X=3 Y=. and then we get the ever popular:

NOTE: SAS went to a new line when INPUT statement reached past the end of a line.

indicating we ran of out data. And the values on the second record of the data set has 4 for the value of Z.

ll12306
Calcite | Level 5

Thanks for your reply.

But I still confused why there is missing value for 2nd observation.

for 2,NCSU,

if we read 2 for rank, ncsu for team, we still need a value for count. why is count not 3??

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 753 views
  • 0 likes
  • 3 in conversation