Date: Thu, 17 Sep 2009 00:06:24 -0700
Reply-To: Amar Mundankar <amarmundankar@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Amar Mundankar <amarmundankar@GMAIL.COM>
Subject: Re: New Field in Table
Content-Type: text/plain; charset=ISO-8859-1
On Sep 17, 5:25 am, miimes1 <michelle.i...@gmail.com> wrote:
> Hi Everyone,
> I am trying to create a new field in my sas table, but I want the new
> field to be based on attributes of another field. I want it based on
> if then statements. For example, I want to create a new column called
> COLUMN. I want to apply 65 different unique IDs, based on a longitude
> if longitude is between -81.5187 and -81.4987 then give COLUMN a 75;
> Any suggestions?
You can create a user defined format and as per the longitude range.
Apply that format to Id variable.
I hope this can help you.
proc format ;
10-20 = '1'
21-30 = '2'
31-40 = '3'
41-50 = '4'
data want ;
id = longitude;
format id myfmt.;
proc print data = want;
Thanks and Regards,