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 (April 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 20 Apr 2009 10:44:27 -0700
Reply-To:   Dornak <postitdummy@ARCOR.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Dornak <postitdummy@ARCOR.DE>
Organization:   http://groups.google.com
Subject:   Re: Help with code
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

I forgot the semicolon and the quit;

proc sql; create table newdataset as select a.* from currentmonth a, standard b where a.market=b.market and a.product=b.product ; quit;

This is equivalent to proc sql; create table newdataset as select a.* from currentmonth a inner join standard b on a.market=b.market and a.product=b.product ; quit;

If you want all lines of currentmonth in newdataset no matter if the same line was found in standard use a left join: proc sql; create table newdataset as select a.* from currentmonth a left join standard b on a.market=b.market and a.product=b.product ; quit;

This may be useful if the market is spelled differently in standard than in the dataset of your company as you wrote.

I do not know much about string matching. Just one thing substr("Hello",2,2) returns "el". You might want to try to match only the first few characters of the market: and substr(a.product,1,5)=substr(b.product,1,5).

There are may string manipulation functions. If you specify your difficulty in matching lines, someone might be able to give more useful advice.

Hope that helps a little.

Dornak


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