<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: merging datasets to generate new column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15731#M2105</link>
    <description>i just want to remove leading zeros in one dataset....so that i can generate new data set by comparing two values.&lt;BR /&gt;
&lt;BR /&gt;
one dataset is a data base table so i can't edit the format.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
    <pubDate>Sat, 18 Jun 2011 04:58:04 GMT</pubDate>
    <dc:creator>brm</dc:creator>
    <dc:date>2011-06-18T04:58:04Z</dc:date>
    <item>
      <title>merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15725#M2099</link>
      <description>data store1;&lt;BR /&gt;
input id  product type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1  112     refferal&lt;BR /&gt;
2  112     approval&lt;BR /&gt;
3  112	   ship&lt;BR /&gt;
4  113     ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112     xyz&lt;BR /&gt;
113     abc&lt;BR /&gt;
115     def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=store1;&lt;BR /&gt;
by product;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=store2;&lt;BR /&gt;
by  product;&lt;BR /&gt;
&lt;BR /&gt;
DATA store3; &lt;BR /&gt;
  MERGE store1 store2; &lt;BR /&gt;
  BY product; &lt;BR /&gt;
RUN: &lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA=store3; &lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
I got output like this &lt;BR /&gt;
&lt;BR /&gt;
id     produc    type      productname&lt;BR /&gt;
3	.	     ship	&lt;BR /&gt;
1	112	     refferal	xyz&lt;BR /&gt;
2	112	     approval	xyz&lt;BR /&gt;
4	113	     ship	abc&lt;BR /&gt;
.	115		        def&lt;BR /&gt;
&lt;BR /&gt;
but i want output to be like this...what changes i have to make.&lt;BR /&gt;
can u please send me the code.&lt;BR /&gt;
&lt;BR /&gt;
In final table i want all the rows from dataset1 and productname from table2.&lt;BR /&gt;
&lt;BR /&gt;
id product productname    type&lt;BR /&gt;
1  112        xyz               refferal&lt;BR /&gt;
2  112        xyz                approval &lt;BR /&gt;
3  112	 xyz                ship	&lt;BR /&gt;
4  113        abc                ship&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
      <pubDate>Thu, 16 Jun 2011 21:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15725#M2099</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-16T21:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15726#M2100</link>
      <description>It looks like you want to keep ALL observations from STORE1 along with any data from STORE2 that happens to match.  Observations in STORE2 that do not match a row in STORE1 should be discarded.  If so, you need an indication to tell you if the STORE1 data set is contributing to the current observation being processed by the MERGE, and the IN= dataset option is your answer.  Try something like this:&lt;BR /&gt;
&lt;BR /&gt;
DATA store3; &lt;BR /&gt;
MERGE store1(in=KeepThis) store2; &lt;BR /&gt;
BY product; &lt;BR /&gt;
if KeepThis;&lt;BR /&gt;
RUN;</description>
      <pubDate>Fri, 17 Jun 2011 01:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15726#M2100</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2011-06-17T01:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15727#M2101</link>
      <description>I would like to get productname from store2,for each product in store1.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
      <pubDate>Fri, 17 Jun 2011 02:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15727#M2101</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-17T02:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15728#M2102</link>
      <description>proc sql;&lt;BR /&gt;
create table work.store3 as &lt;BR /&gt;
select t1.id, t1.product, t2.productname, t1.type&lt;BR /&gt;
from work.store1 t1 left outer join work.store2 t2 on t1.product=t2.product;&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 17 Jun 2011 12:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15728#M2102</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-06-17T12:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15729#M2103</link>
      <description>In one dataset product coloum is like this&lt;BR /&gt;
&lt;BR /&gt;
store1 dataset:&lt;BR /&gt;
&lt;BR /&gt;
product&lt;BR /&gt;
00112&lt;BR /&gt;
00113&lt;BR /&gt;
00114&lt;BR /&gt;
00005&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
store2 dataset:&lt;BR /&gt;
&lt;BR /&gt;
product&lt;BR /&gt;
112&lt;BR /&gt;
113&lt;BR /&gt;
114.&lt;BR /&gt;
&lt;BR /&gt;
How to match these two datasets?</description>
      <pubDate>Fri, 17 Jun 2011 22:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15729#M2103</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-17T22:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15730#M2104</link>
      <description>If they are both numeric, the difference is only the format used to display the values.  Just merge or join by product, and it will work fine.  If not, you'll need to specify the data type for the two columns.</description>
      <pubDate>Sat, 18 Jun 2011 02:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15730#M2104</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2011-06-18T02:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15731#M2105</link>
      <description>i just want to remove leading zeros in one dataset....so that i can generate new data set by comparing two values.&lt;BR /&gt;
&lt;BR /&gt;
one dataset is a data base table so i can't edit the format.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
      <pubDate>Sat, 18 Jun 2011 04:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15731#M2105</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-18T04:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15732#M2106</link>
      <description>Assuming they are both characters (otherwise you wouldn't need to do this):&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table work.final as &lt;BR /&gt;
select s1.id, s1.product, s1.type, s2.productname&lt;BR /&gt;
from xxx.store1 left outer join xxx.store2 on&lt;BR /&gt;
s1.id=put(input(s2.id,3.),z5.);&lt;BR /&gt;
quit;</description>
      <pubDate>Sat, 18 Jun 2011 13:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15732#M2106</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-06-18T13:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15733#M2107</link>
      <description>Assuming they are both characters (otherwise you wouldn't need to do this):&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table work.final as &lt;BR /&gt;
select s1.id, s1.product, s1.type, s2.productname&lt;BR /&gt;
from xxx.store1 left outer join xxx.store2 on&lt;BR /&gt;
s1.id=put(input(s2.id,$3.),z5.);&lt;BR /&gt;
quit;</description>
      <pubDate>Sat, 18 Jun 2011 13:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15733#M2107</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-06-18T13:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15734#M2108</link>
      <description>Dude,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The code is as follows , you will get what you need:-&lt;BR /&gt;
&lt;BR /&gt;
data store1;&lt;BR /&gt;
input id product type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 112 refferal&lt;BR /&gt;
2 112 approval&lt;BR /&gt;
3 112 ship&lt;BR /&gt;
4 113 ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112 xyz&lt;BR /&gt;
113 abc&lt;BR /&gt;
115 def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=store1;&lt;BR /&gt;
by product;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=store2;&lt;BR /&gt;
by product;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
DATA store3;&lt;BR /&gt;
MERGE store1(in=a) store2(in=b);&lt;BR /&gt;
BY product;&lt;BR /&gt;
if a;&lt;BR /&gt;
RUN;</description>
      <pubDate>Sat, 18 Jun 2011 18:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15734#M2108</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2011-06-18T18:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15735#M2109</link>
      <description>id coloum is not there in both tables?&lt;BR /&gt;
&lt;BR /&gt;
product coloum is character in both tables....if i execute query by comparing products getting this error.&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;
ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;
&lt;BR /&gt;
What is the cause for these errors.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
      <pubDate>Sun, 19 Jun 2011 04:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15735#M2109</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-19T04:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15736#M2110</link>
      <description>DBailey,&lt;BR /&gt;
&lt;BR /&gt;
          It works fine for records without leading zeors....but for some of the products in store1 is having leading zeros,so it is not able to match up with product in store2(product is same without zeors)......i just want to make a change in query to match up product in store1 with leading zeros with product in store2(without zeros).&lt;BR /&gt;
&lt;BR /&gt;
can we able to handle that change within this query?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm</description>
      <pubDate>Sun, 19 Jun 2011 06:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15736#M2110</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-19T06:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15737#M2111</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
From what you describe (and unlike in your sample code) variable "product" must be character (else the leading zeros wouldn't matter).&lt;BR /&gt;
&lt;BR /&gt;
Below code converts product to numeric for joining:&lt;BR /&gt;
&lt;BR /&gt;
data store1;&lt;BR /&gt;
input id product $ type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 000112 refferal&lt;BR /&gt;
2 000112 approval&lt;BR /&gt;
3 000112 ship&lt;BR /&gt;
4 000113 ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product $ productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112 xyz&lt;BR /&gt;
113 abc&lt;BR /&gt;
115 def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
/*  create table want as*/&lt;BR /&gt;
    select store1.*, store2.productname&lt;BR /&gt;
    from store1 left join store2&lt;BR /&gt;
    on input(store1.product,8.)=input(store2.product,8.)&lt;BR /&gt;
  ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Sun, 19 Jun 2011 11:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15737#M2111</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-06-19T11:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15738#M2112</link>
      <description>Let's try converting them both to numbers:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table work.final as &lt;BR /&gt;
select s1.id, s1.product, s1.type, s2.productname&lt;BR /&gt;
from xxx.store1 left outer join xxx.store2 on&lt;BR /&gt;
input(s1.id,$5.)=input(s2.id,$5.);&lt;BR /&gt;
quit;</description>
      <pubDate>Sun, 19 Jun 2011 12:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15738#M2112</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-06-19T12:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15739#M2113</link>
      <description>in store1 all products are numeric.&lt;BR /&gt;
in store2 there are some values for product are strings(ex:AUM,xloera etc).&lt;BR /&gt;
&lt;BR /&gt;
so if i'm trying to convert both to numeric having issue.....how can i handle this one.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
brm.</description>
      <pubDate>Mon, 20 Jun 2011 03:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15739#M2113</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-20T03:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15740#M2114</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
As you can see it would be very worthwhile to provide sample data reflecting the real data in first place....&lt;BR /&gt;
&lt;BR /&gt;
In the docu for the input function you can find the special meaning for '?'. Changing your code accordingly should solve your problem: &lt;BR /&gt;
......input(store2.product,? 8.) and input(store2.product,? 8.) ne .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data store1;&lt;BR /&gt;
input id product $ type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 000112 refferal&lt;BR /&gt;
2 000112 approval&lt;BR /&gt;
3 000112 ship&lt;BR /&gt;
4 000113 ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product $ productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112 xyz&lt;BR /&gt;
113 abc&lt;BR /&gt;
115 def&lt;BR /&gt;
A15 def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
/* create table want as*/&lt;BR /&gt;
select store1.*, store2.productname&lt;BR /&gt;
from store1 left join store2&lt;BR /&gt;
on input(store1.product,8.)=input(store2.product,? 8.) &lt;BR /&gt;
and input(store2.product,? 8.) ne .&lt;BR /&gt;
;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Mon, 20 Jun 2011 03:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15740#M2114</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-06-20T03:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15741#M2115</link>
      <description>[pre]&lt;BR /&gt;
&lt;BR /&gt;
data store1;&lt;BR /&gt;
input id product $ type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 000112 refferal&lt;BR /&gt;
2 000112 approval&lt;BR /&gt;
3 000112 ship&lt;BR /&gt;
4 000113 ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product $ productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112 xyz&lt;BR /&gt;
113 abc&lt;BR /&gt;
115 def&lt;BR /&gt;
A15 def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data store11;&lt;BR /&gt;
 set store1;&lt;BR /&gt;
 product=substr(product,verify(product,'0'));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=store11;&lt;BR /&gt;
by product;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=store2;&lt;BR /&gt;
by product;&lt;BR /&gt;
&lt;BR /&gt;
DATA store3;&lt;BR /&gt;
MERGE store11(in=one) store2;&lt;BR /&gt;
BY product;&lt;BR /&gt;
if one;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Or&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data store1;&lt;BR /&gt;
input id product $ type $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 000112 refferal&lt;BR /&gt;
2 000112 approval&lt;BR /&gt;
3 000112 ship&lt;BR /&gt;
4 000113 ship&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data store2;&lt;BR /&gt;
input product $ productname $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
112 xyz&lt;BR /&gt;
113 abc&lt;BR /&gt;
115 def&lt;BR /&gt;
A15 def&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 create table want as&lt;BR /&gt;
  select a.* ,b.productname&lt;BR /&gt;
   from store1 as a left join store2 as b on a.product contains strip(b.product)&lt;BR /&gt;
   ;&lt;BR /&gt;
   quit;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Mon, 20 Jun 2011 08:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15741#M2115</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-20T08:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets to generate new column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15742#M2116</link>
      <description>Thanks everybody.......it worked.....sorry for the confusion.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
brm.</description>
      <pubDate>Mon, 20 Jun 2011 18:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets-to-generate-new-column/m-p/15742#M2116</guid>
      <dc:creator>brm</dc:creator>
      <dc:date>2011-06-20T18:35:25Z</dc:date>
    </item>
  </channel>
</rss>

