Remember The Values
Add one statement to the program above to "fix" it.
Data Nogood;
Retain Subject 0;
Subject = Subject + 1;
Input score1 score2 @@;
Datalines;
3 4 5 6 7 8
;
RETAIN tells SAS not to clear out SUBJECT value in the PDV when starting a new pass through the data step. Further, on the first pass, SUBJECT is initialized with the value 0.