<?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 Dataset in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587647#M28758</link>
    <description>Could you please check in the dataset what is exact name of employeeid may be this variable name is not right</description>
    <pubDate>Tue, 10 Sep 2019 19:12:17 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2019-09-10T19:12:17Z</dc:date>
    <item>
      <title>Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587617#M28752</link>
      <description>&lt;P&gt;I am trying to merge datasets, and this is my code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Load Data*/
data Employees;
    infile "C:/Users/100355202/Desktop/employees.csv" dsd dlm = "09"x;
    input EmployeeID LastName :$20. FirstName :$20. Title :$20. Gender :$20. BirthDate :mmddyy10. 
          HireDate :mmddyy10. Address :$20. City :$20. Region :$20. PostalCode :$20. Country :$20. 
          HomePhone :$20. Extension :$20. ReportsTo;
run;
proc import datafile="C:/Users/100355202/Desktop/employees.csv"  out=employees dbms=csv replace;
         getnames=yes;
run;
/* Merge dataset */
data Employees_Orders;
   merge Employees Orders;
   by EmployeeID;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the orders code is like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Load Data*/
data Orders;
    infile "C:/Users/100355202/Desktop/Orders.txt" dsd dlm = "09"x firstobs = 2;
    input OrderID CustomerID :$20. EmployeeID :$20. OrderDate :mmddyy10. 
          RequiredDate :mmddyy10. ShippedDate :mmddyy10. ShipVia Freight 
          ShipName :$20. ShipAddress :$20. ShipCity :$20. ShipRegion :$20. 
          ShipPostalCode :$20. ShipCountry :$20. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and I am getting these notes&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merge.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32351i36D1BA0FEB31B109/image-size/large?v=v2&amp;amp;px=999" role="button" title="merge.PNG" alt="merge.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;can anyone help me solve this&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587617#M28752</guid>
      <dc:creator>genius99</dc:creator>
      <dc:date>2019-09-10T17:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587627#M28753</link>
      <description>&lt;P&gt;If you run the below code after reading the data files then you should not get the error what you posted&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Merge dataset */
data Employees_Orders;
   merge Employees Orders;
   by EmployeeID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587627#M28753</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T18:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587638#M28754</link>
      <description>&lt;P&gt;I tried to sort them first,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Load Employees*/
data Employees;
    infile "C:/Users/100355202/Desktop/employees.csv" dsd dlm = "09"x;
    input EmployeeID LastName :$20. FirstName :$20. Title :$20. Gender :$20. BirthDate :mmddyy10. 
          HireDate :mmddyy10. Address :$20. City :$20. Region :$20. PostalCode :$20. Country :$20. 
          HomePhone :$20. Extension :$20. ReportsTo;

proc import datafile="C:/Users/100355202/Desktop/employees.csv"  out=employees dbms=csv replace;
         getnames=yes;
run;
/*Load Orders*/
data Orders;
    infile "C:/Users/100355202/Desktop/Orders(1).txt" dsd dlm = "09"x firstobs = 2;
    input OrderID CustomerID :$20. EmployeeID OrderDate :mmddyy10. 
          RequiredDate :mmddyy10. ShippedDate :mmddyy10. ShipVia Freight 
          ShipName :$20. ShipAddress :$20. ShipCity :$20. ShipRegion :$20. 
          ShipPostalCode :$20. ShipCountry :$20. ;
run;

/*Sort Employees*/
data Employees;
    proc sort employees;
    by EmployeeID;
run;

/*Sort orders*/
data orders;
    Proc sort orders;
    by EmployeeID;
run;

/* Merge dataset */
data Employees_Orders;
   merge Employees Orders;
   by EmployeeID;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and now I have this note&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sort.PNG" style="width: 477px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32356i22B602F85F33C2D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="sort.PNG" alt="sort.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587638#M28754</guid>
      <dc:creator>genius99</dc:creator>
      <dc:date>2019-09-10T18:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587639#M28755</link>
      <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Sort Employees*/
    proc sort data=employees;
    by EmployeeID;
run;

/*Sort orders*/
    Proc sort data=orders;
    by EmployeeID;
run;

/* Merge dataset */
data Employees_Orders;
   merge Employees Orders;
   by EmployeeID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587639#M28755</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T18:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587645#M28757</link>
      <description>&lt;P&gt;it's not working out still,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="not.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32358iF781E1BA1F982336/image-size/large?v=v2&amp;amp;px=999" role="button" title="not.PNG" alt="not.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="code.PNG" style="width: 290px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32359i1EF5DA989D3880B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="code.PNG" alt="code.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 19:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587645#M28757</guid>
      <dc:creator>genius99</dc:creator>
      <dc:date>2019-09-10T19:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587647#M28758</link>
      <description>Could you please check in the dataset what is exact name of employeeid may be this variable name is not right</description>
      <pubDate>Tue, 10 Sep 2019 19:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587647#M28758</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T19:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587649#M28759</link>
      <description>&lt;P&gt;the name is still employeeid&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="id.PNG" style="width: 386px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32360iD93DCDC66C9433B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="id.PNG" alt="id.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 19:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587649#M28759</guid>
      <dc:creator>genius99</dc:creator>
      <dc:date>2019-09-10T19:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587650#M28760</link>
      <description>ok but seems like it does not have the employee id, the employeeid variable have the dates, are you sure it is correct.</description>
      <pubDate>Tue, 10 Sep 2019 19:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587650#M28760</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T19:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587653#M28761</link>
      <description>&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;I am trying to merge datasets, and this is my code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Load Data*/
data Employees;
    infile "C:/Users/100355202/Desktop/employees.csv" dsd dlm = "09"x;
    input EmployeeID LastName :$20. FirstName :$20. Title :$20. Gender :$20. BirthDate :mmddyy10. 
          HireDate :mmddyy10. Address :$20. City :$20. Region :$20. PostalCode :$20. Country :$20. 
          HomePhone :$20. Extension :$20. ReportsTo;
run;
proc import datafile="C:/Users/100355202/Desktop/employees.csv"  out=employees dbms=csv replace;
         getnames=yes;
run;
/* Merge dataset */
data Employees_Orders;
   merge Employees Orders;
   by EmployeeID;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the orders code is like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Load Data*/
data Orders;
    infile "C:/Users/100355202/Desktop/Orders.txt" dsd dlm = "09"x firstobs = 2;
    input OrderID CustomerID :$20. EmployeeID :$20. OrderDate :mmddyy10. 
          RequiredDate :mmddyy10. ShippedDate :mmddyy10. ShipVia Freight 
          ShipName :$20. ShipAddress :$20. ShipCity :$20. ShipRegion :$20. 
          ShipPostalCode :$20. ShipCountry :$20. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I am getting these notes&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merge.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32351i36D1BA0FEB31B109/image-size/large?v=v2&amp;amp;px=999" role="button" title="merge.PNG" alt="merge.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;can anyone help me solve this&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Cause of the first error. The syntax to reference a data set is Library.Dataset&amp;nbsp;&amp;nbsp; one and only one period is allowed.&lt;/P&gt;
&lt;P&gt;(Actually a one of the SAS products does allow syntax with more periods but in that case ORDERS would be some sort of member of Work.Employees such as a variable in a data set)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show the log from running your data step creating the Orders dataset. HOWEVER the merge wouldn't work any way.&lt;/P&gt;
&lt;P&gt;In your employees data set employeeid is NUMERIC:&lt;/P&gt;
&lt;PRE&gt;input EmployeeID LastName :$20.&lt;/PRE&gt;
&lt;P&gt;reads it as numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your Orders data step:&lt;/P&gt;
&lt;PRE&gt;input OrderID CustomerID :$20. EmployeeID :$20.&lt;/PRE&gt;
&lt;P&gt;reads EmployeeId as a character variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But with the error of work.orders does not exist makes me suspect that either the data stepping reading the data failed and did not create the data set or was not actually submitted.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 19:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Dataset/m-p/587653#M28761</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-10T19:38:41Z</dc:date>
    </item>
  </channel>
</rss>

