<?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 Issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307819#M65985</link>
    <description>&lt;P&gt;You must prefix the dataset name with the library name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;set Assign2.Purchase Assign2.Inventory;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;WORK is the default library when no prefix is specified.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2016 02:42:27 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-10-28T02:42:27Z</dc:date>
    <item>
      <title>Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307765#M65961</link>
      <description>&lt;P&gt;Hello guys, for an assignment, I have to merge 2 sas datasets into a single temporary data set, as specified below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUESTION:&lt;/STRONG&gt;&lt;BR /&gt;Merge the Purchase and Inventory data sets to create a new, temporary SAS data set (named Pur_Price) where&lt;BR /&gt;the Price value found in the Inventory data set is added to each observation in the Purchase data set,&lt;BR /&gt;based on the Model number (Model). There are some models in the Inventory data set that were not purchased&lt;BR /&gt;(and, therefore, are not in the Purchase data set). Do not include these models in your new data set.&lt;BR /&gt;Based on the variable Quantity in the Purchase data set, obtain a total cost (TotalCost) equal to Quantity x Price&lt;BR /&gt;in this data set as well. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I wrote, creating a the libname to direct to my sas data sets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDITOR:&lt;/STRONG&gt;&lt;BR /&gt;%let path=C:\445_695\Course_Data;&lt;BR /&gt;libname Assign2 "&amp;amp;path";&lt;BR /&gt;&lt;BR /&gt;data Pur_Price;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set Purchase Inventory&amp;nbsp; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once I submit the code, I receive the following message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;73&amp;nbsp;&amp;nbsp; %let path=C:\445_695\Course_Data;&lt;BR /&gt;74&amp;nbsp;&amp;nbsp; libname Assign2 "&amp;amp;path";&lt;BR /&gt;NOTE: Libref ASSIGN2 refers to the same physical library as TMP2.&lt;BR /&gt;NOTE: Libref ASSIGN2 was successfully assigned as follows:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V9&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical Name: C:\445_695\Course_Data&lt;BR /&gt;75&lt;BR /&gt;76&amp;nbsp;&amp;nbsp; data Pur_Price;&lt;BR /&gt;77&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Purchase Inventory&amp;nbsp; ;&lt;BR /&gt;ERROR: File WORK.PURCHASE.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.INVENTORY.DATA does not exist.&lt;BR /&gt;78&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.PUR_PRICE may be incomplete.&amp;nbsp; When this step was stopped there were&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 observations and 0 variables.&lt;BR /&gt;WARNING: Data set WORK.PUR_PRICE was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me out with why the datasets would be assigned to the work library and not my created library Assign2 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307765#M65961</guid>
      <dc:creator>gf1996</dc:creator>
      <dc:date>2016-10-27T21:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307809#M65981</link>
      <description>&lt;P&gt;You need to direct them to your library. However, you're not 'merging' datasets here, you're appending the datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=C:\445_695\Course_Data;
libname Assign2 "&amp;amp;path";

data Pur_Price;
   set assign2.Purchase (in=pur)
          assign2.Inventory (in=inv)  ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This page in the documentation covers many of the different ways of combining SAS datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you're looking for a one to one merge instead, so something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Pur_Price;
&amp;nbsp;&amp;nbsp; merge assign2.Purchase (in=pur)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assign2.Inventory (in=inv)&amp;nbsp; ;
by Model;

if pur=1;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 02:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307809#M65981</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-28T02:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307810#M65982</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112194"&gt;@gf1996&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello guys&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI - a large portion of participants on here are not guys.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 02:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307810#M65982</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-28T02:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307819#M65985</link>
      <description>&lt;P&gt;You must prefix the dataset name with the library name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;set Assign2.Purchase Assign2.Inventory;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;WORK is the default library when no prefix is specified.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 02:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/307819#M65985</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-10-28T02:42:27Z</dc:date>
    </item>
  </channel>
</rss>

