<?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 merging data in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/merging-data/m-p/587706#M7931</link>
    <description>&lt;P&gt;how can I merge the datasets keeping both Rate_1M_CD fields as different fields by renaming the my_citimon version as MON_RATE&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.my_citiday;
  set sashelp.citiday;
  if '01-JAN-88'd &amp;lt;= date &amp;lt;= '31-OCT-88'd and day(date)='01';
  DowComposite=snydjcm;
  Rate_1M_CD = dcd1m;
  keep date DowComposite Rate_1M_CD;
run;

data work.my_citimon;
  set sashelp.citimon;
  if '01-MAR-88'd &amp;lt;= date &amp;lt;= '31-DEC-88'd;
  format date DATE9.;
  Rate_1M_CD = FSPCAP/100;
  Common_Stock_Price_Index = FSPCON;
  keep date Rate_1M_CD Common_Stock_Price_Index;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Sep 2019 00:44:16 GMT</pubDate>
    <dc:creator>genius99</dc:creator>
    <dc:date>2019-09-11T00:44:16Z</dc:date>
    <item>
      <title>merging data</title>
      <link>https://communities.sas.com/t5/SAS-Studio/merging-data/m-p/587706#M7931</link>
      <description>&lt;P&gt;how can I merge the datasets keeping both Rate_1M_CD fields as different fields by renaming the my_citimon version as MON_RATE&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.my_citiday;
  set sashelp.citiday;
  if '01-JAN-88'd &amp;lt;= date &amp;lt;= '31-OCT-88'd and day(date)='01';
  DowComposite=snydjcm;
  Rate_1M_CD = dcd1m;
  keep date DowComposite Rate_1M_CD;
run;

data work.my_citimon;
  set sashelp.citimon;
  if '01-MAR-88'd &amp;lt;= date &amp;lt;= '31-DEC-88'd;
  format date DATE9.;
  Rate_1M_CD = FSPCAP/100;
  Common_Stock_Price_Index = FSPCON;
  keep date Rate_1M_CD Common_Stock_Price_Index;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/merging-data/m-p/587706#M7931</guid>
      <dc:creator>genius99</dc:creator>
      <dc:date>2019-09-11T00:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: merging data</title>
      <link>https://communities.sas.com/t5/SAS-Studio/merging-data/m-p/587707#M7932</link>
      <description>&lt;P&gt;One option is to rename the variable in the data step shown.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace the items in red, with the items in blue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.my_citimon;
  set sashelp.citimon;
  if '01-MAR-88'd &amp;lt;= date &amp;lt;= '31-DEC-88'd;
  format date DATE9.;
 &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt; Rate_1M_CD = FSPCAP/100;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;STRONG&gt;&lt;FONT size="5" color="#3366FF"&gt;MON_RATE = FSPCAP/100;&lt;/FONT&gt;&lt;/STRONG&gt;
  Common_Stock_Price_Index = FSPCON;
  keep date &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Rate_1M_CD&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;MON_RATE&lt;/STRONG&gt;&lt;/FONT&gt; Common_Stock_Price_Index;
run;&lt;/PRE&gt;
&lt;P&gt;Another is to use the data set options RENAME to change the name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
merge my_citiday mycitimon (rename = (rate_1m_cd = mon_rate));&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289391"&gt;@genius99&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how can I merge the datasets keeping both Rate_1M_CD fields as different fields by renaming the my_citimon version as MON_RATE&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.my_citiday;
  set sashelp.citiday;
  if '01-JAN-88'd &amp;lt;= date &amp;lt;= '31-OCT-88'd and day(date)='01';
  DowComposite=snydjcm;
  Rate_1M_CD = dcd1m;
  keep date DowComposite Rate_1M_CD;
run;

data work.my_citimon;
  set sashelp.citimon;
  if '01-MAR-88'd &amp;lt;= date &amp;lt;= '31-DEC-88'd;
  format date DATE9.;
  Rate_1M_CD = FSPCAP/100;
  Common_Stock_Price_Index = FSPCON;
  keep date Rate_1M_CD Common_Stock_Price_Index;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/merging-data/m-p/587707#M7932</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-11T00:48:44Z</dc:date>
    </item>
  </channel>
</rss>

