Hi,
I have a numeric column which has all rows equal to 810,225.
I would like to create a new column which increments this value by one for each row. So row one would equal 810,225 row 2 would be 810,226, row 3 would be 810,227 and so on.
Could anyone provide some advice as the best way to do this?
data want;
set have;
new_value = old_Value + ( _N_ - 1 );
run;
Koen
data want;
set have;
new_num_col = num_col + _n_;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.