I learned it a year ago at my SAS Base course, but right now, I don't remember anymore... If anyone could help me?
I've got a dataset with ID numbers, accompanied by dates (so several ID numbers are the same). Only the first of some ID numbers is flagged with FLAG=1. Now I want all the flagged numbers to have a FLAG=1 for all of them. See below a sample:
The RETAIN statement need not be coded within the DO/END, it is interpreted at compilation. Also, if you are missing a BY statement, then you would see pertinent diagnostic messages in your SAS log about UNINITIALIZED. You will want reset the variable back to 0 or a SAS missing_value, I expect with each new FIRST.ID condition, correct?