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 (May 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 16 May 2001 11:47:14 -0400
Reply-To:     Simon Pickles <simon.pickles@FIDELITY.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Simon Pickles <simon.pickles@FIDELITY.COM>
Subject:      Re: Generating unique values?

I imagine what you want is something like an AUTOKEY in Ms Access. As far as I know SAS doen't have this. I've always had to use a counter dataset separate to the main table and this counter holds the next available integer id.

I do something like:

data perm.idcount; call symput('nextid',idcount); idcount+1; run;

then use &idcount as your unique value.

Using such a datastep with a counter table prevents the possibility of multiple users getting the same value as the counter table is locked while you get the id and update it.

Simon

On Tue, 15 May 2001 15:39:00 +0200, news <akepka@ELEKTRON.RIVNET> wrote:

>Hi Everyone > >I must add data row to data set from www form(AppDispacher). In this set is >field ID - primary key. >I want generate unique value for field ID. In Oracle I have sequence to >generate unique value. How can I do it in SAS? > >Thanks >Artur


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