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 (September 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 20 Sep 2005 06:29:41 -0700
Reply-To:     Toby <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Toby <tobydunn@HOTMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: add an index column
Comments: To: sas-l@uga.edu
In-Reply-To:  <20050920064915.85092.qmail@web53801.mail.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Patrick,

All you need to do is something like the following:

Data one (index = (IndexVar)) ; set something ;

IndexVar = compress("Example_"||_n_) ; run ;

Toby Dunn

Hi there, I would like to add an INDEX column (to index each row/example) into an existing dataset. So, the first column would be in the form as floow:

example_1 example_2 example_3 example_4 example_5

I tried to use DATA step with SET statement but the index does not increment. Could some please please help? Thanks Patrick Tran


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