@sas_nutzer wrote:
Thank you for the answer, but the source says: "The RETAIN statement is most often used to reorder variables because no other variable attribute specifications are required. The RETAIN statement has no effect on retaining values of existing variables being read from the data set."
So it shouldn't behave like that, should it?
The important part is this:
of existing variables being read from the data set
Since dummy is not being read from a dataset, it is affected by the RETAIN statement.
Although existing variables (those read by a SET or MERGE) are retained by definition, they are always overwritten when a new observation is read. Dummy is not overwritten and therefore keeps its value.
... View more