<?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: code to match merge in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321153#M70842</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input idno  abbrivation $  Amt;
cards;
101 asd 2000
102 dfg 2000
;
run;

data want;
set temp (where=(idno = 101));
set temp (where=(idno1 = 102) rename=(idno =idno1 abbrivation=abbrivation1 Amt=Amt1));
Difference = Amt - Amt1;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Google 'Use of Multiple Set Statement' to read more about it. Check out this link - &lt;A href="http://www.listendata.com/2015/12/use-of-multiple-set-statements.html" target="_self"&gt;Use of Multiple SET statement&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2016 10:49:45 GMT</pubDate>
    <dc:creator>Ujjawal</dc:creator>
    <dc:date>2016-12-26T10:49:45Z</dc:date>
    <item>
      <title>code to match merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321143#M70834</link>
      <description>&lt;P&gt;the input data is in rows one below the other while the output required is defined in the excel attached as there are only two pair of unique codes so if unique code =101 then it should be paired with 102 only taking the row data into column.&lt;/P&gt;&lt;P&gt;eg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input data&lt;/P&gt;&lt;P&gt;idno. &amp;nbsp;abbrivation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Amt&lt;/P&gt;&lt;P&gt;101 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asd &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;102 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dfg &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;output expected&amp;nbsp;&lt;/P&gt;&lt;P&gt;idno &amp;nbsp; &amp;nbsp; &amp;nbsp;Abbrivation &amp;nbsp; &amp;nbsp; Amt1 &amp;nbsp; &amp;nbsp; &amp;nbsp;idno &amp;nbsp; &amp;nbsp;abbrivation &amp;nbsp; &amp;nbsp; &amp;nbsp; Amt2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Difference(Amt1-Amt2)&lt;/P&gt;&lt;P&gt;101 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asd &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000 &amp;nbsp; &amp;nbsp; &amp;nbsp;102 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dfg &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;more detail willbe find in excel.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 07:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321143#M70834</guid>
      <dc:creator>snehalrao</dc:creator>
      <dc:date>2016-12-26T07:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: code to match merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321153#M70842</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input idno  abbrivation $  Amt;
cards;
101 asd 2000
102 dfg 2000
;
run;

data want;
set temp (where=(idno = 101));
set temp (where=(idno1 = 102) rename=(idno =idno1 abbrivation=abbrivation1 Amt=Amt1));
Difference = Amt - Amt1;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Google 'Use of Multiple Set Statement' to read more about it. Check out this link - &lt;A href="http://www.listendata.com/2015/12/use-of-multiple-set-statements.html" target="_self"&gt;Use of Multiple SET statement&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 10:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321153#M70842</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2016-12-26T10:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: code to match merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321154#M70843</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input idno  abbrivation $  Amt;
cards;
101 asd 2000
102 dfg 2000
;
run;

data want;
set temp (where=(idno = 101));
set temp (rename=(idno =idno1 abbrivation=abbrivation1 Amt=Amt1) where=(idno1 = 102));
Difference = Amt - Amt1;&lt;BR /&gt;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can google 'Multiple use of SET statement' to know more about it.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 10:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321154#M70843</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2016-12-26T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: code to match merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321219#M70883</link>
      <description>&lt;P&gt;I see only&amp;nbsp;a tenuous connection between your statement of the sample output and the spreadsheet you sent.&amp;nbsp; It is not clear from your sample "input" data&amp;nbsp; where the spreasheet variables sr.no,&amp;nbsp; lamt, bcode, bno, and bamt come from.&amp;nbsp; Moreover your spreadsheet has lno="c101", bno="c102", etc., while your problem statement has 101, 102.&amp;nbsp; Which is it?&amp;nbsp; Character or numeric?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are matches done by you variables "sr.no"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you stating that the "L" variables all come from records with&amp;nbsp;idno's ending in "1", and the "B" variables all come from records with idno's ending in "2"?&amp;nbsp; Are there any other idno values that don't end in "1" or "2"?&amp;nbsp; What do you want if only the "1" or "2" record is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can guess what you want, but instead of waiting for us to read you mind, perhaps you can clarify.&amp;nbsp; That way we won't guess wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 02:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321219#M70883</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-12-27T02:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: code to match merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321226#M70887</link>
      <description>&lt;PRE&gt;
Post more data here. Not attach a excel file. No one would like to download a Excel file.


&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Dec 2016 03:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-to-match-merge/m-p/321226#M70887</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-27T03:35:57Z</dc:date>
    </item>
  </channel>
</rss>

