LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2012, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Feb 2012 11:11:32 -0500
Reply-To:     Richard DeVenezia <rdevenezia@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Richard DeVenezia <rdevenezia@GMAIL.COM>
Subject:      Is there a way to auto increment a column ?

Hello:

I am looking for a way to auto-increment an ID column. I don't want to use a max(ID)+1 technique because rows might be deleted (such as the last row) and ID values should not be re-used.

proc sql; create table foo ( id num , name char(50) );

%* can id be autocomputed in some trigger way ?; insert into foo(name) values ( 'Hey there');

%* id autocomputed in some forced way (non-atomic :()?; insert into foo(id,name) values ( %NextId(foo), 'Hey there');

Thanks, Richard A. DeVenezia


Back to: Top of message | Previous page | Main SAS-L page