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 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 17 Sep 2003 12:07:48 +0200
Reply-To:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:   Re: create dataset with added column
Comments:   To: mmxell <docdoc1357@TIPGOD.COM>
Content-Type:   text/plain; charset="iso-8859-1"

Hi MMxell,

I assume with Index you mean the sequence number of the observation in the dataset. If so, in the/a data step add either the line: SeqNum = _N_; or SeqNum + 1;

Where do you want it for?

Regards - Jim.

Y. (Jim) Groeneveld MSc Biostatistician Vitatron B.V. Meander 1051 6825 MJ Arnhem The Netherlands +31/0 26 376 7365; fax 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

-----Original Message----- From: mmxell [mailto:docdoc1357@TIPGOD.COM] Sent: Wednesday, September 17, 2003 09:45 To: SAS-L@LISTSERV.UGA.EDU Subject: create dataset with added column

Hi,

I want to create a dataset from a .txt file (say desc.txt). The content of the file contains only 1 text description(sample as below) abc xyz aaa

I want to create a dataset that has 2 fields: 1)index 2)desc , the result dataset desired is as follows: index desc 1 abc 2 xyz 3 aaa 4 ... 5 .... and etc.

can I do it in the DATA step? Thanks for the advice. mmxell


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