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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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