BookmarkSubscribeRSS Feed

This suggested NOTE would be issued when, in a DATA step, a variable is retained which is present in an incoming dataset; since such variables are automatically retained, this points to a mistake on the part of the coder who wants to create a new variable, and who will be surprised that "the RETAIN does not work" because the retained value is always overwritten by the next observation that is read.

Something like

NOTE: Variable XXX is read from dataset YYY and therefore automatically retained.

1 Comment
Opal | Level 21

I wonder if this note would be worth the extra noise, since the RETAIN statement is (more?) often used for its side effect of reordering variables than for its main effect.