<?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: Merge in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844152#M333733</link>
    <description>&lt;P&gt;What part of the documentation do you need an explanation for? Please be specific.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 15:41:36 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-11-14T15:41:36Z</dc:date>
    <item>
      <title>Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616698#M180575</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Another one, Please correct me, if I am wrong&lt;/P&gt;
&lt;P&gt;#5- do not know how to get it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Scenario:&lt;/P&gt;
&lt;P&gt;1.Souj.&lt;STRONG&gt;input24a&lt;/STRONG&gt; contains 2 variables, &lt;STRONG&gt;Product&lt;/STRONG&gt; and&lt;STRONG&gt; Qty&lt;/STRONG&gt; for 20 transactions&lt;/P&gt;
&lt;P&gt;2.Souj.&lt;STRONG&gt;input24b&lt;/STRONG&gt; contains 2 variables, &lt;STRONG&gt;Product&lt;/STRONG&gt; and &lt;STRONG&gt;Price&lt;/STRONG&gt; for 20 transactions&lt;/P&gt;
&lt;P&gt;3.Create output dataset &lt;STRONG&gt;results.output24&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;4.&lt;STRONG&gt;Merge&lt;/STRONG&gt; data sets&lt;STRONG&gt; Souj.input24a&lt;/STRONG&gt; and &lt;STRONG&gt;Souj.input24b&lt;/STRONG&gt; one-to-one in order to calculate a &lt;STRONG&gt;new variable&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;totalprice(=Qtr*Price)&lt;/STRONG&gt; for each observation&lt;/P&gt;
&lt;P&gt;5. what is the &lt;STRONG&gt;grand total&lt;/STRONG&gt; totalprice for the product='screwdriver'?&lt;/P&gt;
&lt;P&gt;6.what is the average(mean) totalprice for product='Tape'? */&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=Souj.input24a &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=out.input24a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; product;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=Souj.input24b &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=out.input24b;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; product;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; results.output24;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;merge&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; out.input24a out.input24b;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; product;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;totalPrice=gty*price;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=results.output24;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; product;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; product=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Tape'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;/* I think #6)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 17:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616698#M180575</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-11T17:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616704#M180580</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301371"&gt;@souji&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At first sight it seems that proc means should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=results.output24 mean;
var totalprice;
where product='Tape';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is also a typo -&amp;gt;&amp;nbsp;&lt;SPAN&gt;gty should be replaced by qty in your code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The very first thing to do would be to &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;try your code&lt;/STRONG&gt;&lt;/FONT&gt;!&lt;/P&gt;
&lt;P&gt;You will easily see if the syntax is correct and if you get the right results (especially in this case, as there are very few variables and observations).&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 17:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616704#M180580</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-11T17:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616706#M180582</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your quick response, I appreciate you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What about : &amp;nbsp;5. what is the &lt;STRONG&gt;grand total&lt;/STRONG&gt; totalprice for the product='screwdriver'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please help me this too&lt;/P&gt;
&lt;P&gt;Souji&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 18:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616706#M180582</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-11T18:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616710#M180584</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301371"&gt;@souji&lt;/a&gt;,&lt;BR /&gt;You’re welcome!&lt;BR /&gt;For question 5, I believe you are asked to compute the sum of totalprice of screwdrivers.&lt;BR /&gt;An easy way to do that is to use a proc  print :&lt;BR /&gt;Proc print data=results.output24;&lt;BR /&gt;Sum totalprice ;&lt;BR /&gt;Where product = ‘screwdriver’;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;You can also use a proc means -&amp;gt; change mean by sum in your code and adapt the condition where.&lt;BR /&gt;&lt;BR /&gt; Best</description>
      <pubDate>Sat, 11 Jan 2020 18:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/616710#M180584</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-11T18:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844150#M333732</link>
      <description>&lt;P&gt;&lt;STRONG&gt;IN QUESTION&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Merge&lt;/STRONG&gt;&amp;nbsp;data sets&amp;nbsp;Souj.input24a&amp;nbsp;and&amp;nbsp;Souj.input24b&lt;STRONG&gt;&amp;nbsp;one-to-one&lt;/STRONG&gt; in order to calculate a&amp;nbsp;new variable&lt;/P&gt;&lt;P&gt;totalprice=(Qtr*Price)&amp;nbsp;for each observation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;one-to-one merge (using without by statement)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;match merge(using by statement)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/n11fri54im86d4n1imc3rzeeffyt.htm#:~:text=Therefore%2C%20a%20one%2Dto%2D,must%20use%20a%20match%2" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/n11fri54im86d4n1imc3rzeeffyt.htm#:~:text=Therefore%2C%20a%20one%2Dto%2D,must%20use%20a%20match%2&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;please can some one explain????????&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844150#M333732</guid>
      <dc:creator>Mona4</dc:creator>
      <dc:date>2022-11-14T15:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844152#M333733</link>
      <description>&lt;P&gt;What part of the documentation do you need an explanation for? Please be specific.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844152#M333733</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-14T15:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844182#M333743</link>
      <description>*difference between One-to-one merging and match merging*&lt;BR /&gt;&lt;BR /&gt;Souj.input24a contains 2 variables, Product and Qty for 20 transactions&lt;BR /&gt;2.Souj.input24b contains 2 variables, Product and Price for 20 transactions&lt;BR /&gt;3.&lt;BR /&gt;*Create output dataset results.output24 4.Merge data&lt;BR /&gt;sets Souj.input24a and Souj.input24b one-to-one in order to calculate a new&lt;BR /&gt;variable*&lt;BR /&gt;totalprice(=Quantity*Price) for each observation&lt;BR /&gt;5. what is the grand total totalprice for the product='screwdriver'?&lt;BR /&gt;6.what is the average(mean) totalprice for product='Tape’?&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Nov 2022 19:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844182#M333743</guid>
      <dc:creator>Mona4</dc:creator>
      <dc:date>2022-11-14T19:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844183#M333744</link>
      <description>&lt;P&gt;Souj.input24a&amp;nbsp;contains 2 variables,&amp;nbsp;Product&amp;nbsp;and&amp;nbsp;Qty&amp;nbsp;for 20 transactions&lt;BR /&gt;2.Souj.input24b&amp;nbsp;contains 2 variables,&amp;nbsp;Product&amp;nbsp;and&amp;nbsp;Price&amp;nbsp;for 20 transactions&lt;BR /&gt;&lt;STRONG&gt;3.Create output dataset&amp;nbsp;results.output24&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;4.Merge&amp;nbsp;data sets&amp;nbsp;Souj.input24a&amp;nbsp;and&amp;nbsp;Souj.input24b&amp;nbsp;one-to-one in order to calculate a&amp;nbsp;new variable&lt;/STRONG&gt;&lt;BR /&gt;totalprice(=Quantity*Price)&amp;nbsp;for each observation&lt;BR /&gt;5. what is the&amp;nbsp;grand total&amp;nbsp;totalprice for the product='screwdriver'?&lt;BR /&gt;6.what is the average(mean) totalprice for product='Tape’?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 19:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844183#M333744</guid>
      <dc:creator>Mona4</dc:creator>
      <dc:date>2022-11-14T19:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844201#M333755</link>
      <description>&lt;P&gt;What part of this are you having trouble with? Can you show us the code you have tried so far?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 20:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge/m-p/844201#M333755</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-14T20:10:41Z</dc:date>
    </item>
  </channel>
</rss>

