LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Jul 2000 20:48:28 GMT
Reply-To:     yorgiv@MY-DEJA.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         yorgiv@MY-DEJA.COM
Organization: Deja.com - Before you buy.
Subject:      index variable by group

Hello friends,

I would like to find a way to create an index variable in a single data set by a group. An example will help of course:

A B 5 1 3 2 12 2 8 1 1 2 2 1

then i do this:

proc sort; by B A; run; Now what I want is this:

B A index 1 2 1 1 5 2 1 8 3 2 1 1 2 3 2 2 12 3

I want to do this so that I can then use the ranuni function to randomly select an A from each group of B. But I have trouble creating the index variable as above. Thank you for any help,

Sincerely, Yorgi V.

Sent via Deja.com http://www.deja.com/ Before you buy.


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