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 (November 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 26 Nov 2003 14:11:56 -0500
Reply-To:     "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Subject:      Re: Vlookup feature in SAS?
Content-Type: text/plain; charset="iso-8859-1"

Todd:

SAS (in)formats will give you somewhat similar results. RTFM for more details on (in)formats, PROC FORMAT etc.. Note that you can specify a value for 'other' as well when creating the format.

data in; retain fmtname 'blah' type 'i';

input start label 5.2 col1 ; cards; 2003 0.03 0.0375 2004 0.00 0.02 2005 0.00 0.02 2006 0.00 0.02 2007 0.00 0.02 2008 0.00 0.02 2009 0.00 0.02 2010 0.00 0.02 2011 0.00 0.02 2012 0.00 0.02 2013 0.00 0.02 run;

proc format cntlin=in; run;

data a; format col1 5.2; do year = 2003 to 2015; col1 = input(year,blah.); output; end; run;

proc print; run;

-----Original Message----- From: Todd A Goselin [mailto:tgoselin@YAHOO.COM] Sent: Wednesday, November 26, 2003 1:31 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Vlookup feature in SAS?

Hello,

I have a dataset that looks like:

2003 0.03 0.0375

2004 0.00 0.02

2005 0.00 0.02

2006 0.00 0.02

2007 0.00 0.02

2008 0.00 0.02

2009 0.00 0.02

2010 0.00 0.02

2011 0.00 0.02

2012 0.00 0.02

2013 0.00 0.02;

All I want to do is use something like the Microsoft Excell Vlookup function that uses a keyword (in this case a Year, and get the next columns data.

Does anyone have an idea what to do? It looks like SAS does not have a vlookup feature.

My goal is to have something scan the table above and get the second column for a specific year.

Thanks,

Todd

--------------------------------- Do you Yahoo!? Free Pop-Up Blocker - Get it now


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