Using SAS 9.4
I have many records and I am trying to give each record a number starting with 835 and counting up by 1 from there (836, 837, etc.). I have run the following the code:
proc sort data = controls_merged_back;
by ID;
run;
data step12;
set controls_merged_back;
keep record_id group match_key_final match_key_new2 ID Sex dob side scope_date scope_md Date_of_TKA tka_md obs4;
by ID;
if first.ID then record_id = 835;
mrn +1;
if last.ID then output;
run;
The ID variable I have is unique to each so if my thought was to start with the first ID = to 835 and count by 1 from there. However, when I run this code it produces 835 in each record, so I obviously did something wrong. If anyone has any suggestions that would be great. Thank you