- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-31-2022 08:50 AM
(1705 views)
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?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data want;
set have;
new_value = old_Value + ( _N_ - 1 );
run;
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data want;
set have;
new_num_col = num_col + _n_;
run;