BookmarkSubscribeRSS Feed
Sean_OConnor
Fluorite | Level 6

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
sbxkoenk
SAS Super FREQ
data want;
 set have;
 new_value = old_Value + ( _N_ - 1 );
run;

Koen

andreas_lds
Jade | Level 19
data want;
  set have;
  new_num_col = num_col + _n_;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1235 views
  • 0 likes
  • 3 in conversation