BookmarkSubscribeRSS Feed
art297
Opal | Level 21

No.  Actually, I should have dropped counter and mcounter from the code. I only included them so that you could see what was going on.  Also, Haikuo's latest proc sort offering does the same thing and is a simpler/better solution.

It is 7 1 0, as it is the first record, thus counter eq 1 and no missing values have been encountered as yet.

For the next two records, counter gets incremented to 2 and 3, respectively, while mcounter gets incremented to 1 and 2, respectively.  However, since mcounter ends up being 2, while counter is 3, the missing value records are not output.

robertrao
Quartz | Level 8

Hi Arthur,

Thanks a lot. Was a bit confused and forgot that the

if last. no and counter eq mcounter  ..............is under the if missing(x) condition

First it is evaluating all the missing.........

else if last.x considers only the non missing

DID I GET THAT RIGHT?????

Thanks

art297
Opal | Level 21

Backwards (sort of): first it is evaluating all of the non-missing, then the missing, as that is the way the records were sorted.  However, in order of the conditions, you are totally correct.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 17 replies
  • 1901 views
  • 1 like
  • 5 in conversation