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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 3534 views
  • 1 like
  • 5 in conversation