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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2074 views
  • 1 like
  • 5 in conversation