<?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 What is wrong with my merging data set here ? What would be my solution on combing these 2 datasets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774047#M31200</link>
    <description>&lt;PRE&gt;&lt;CODE class=""&gt;/*Example 7: Merging datasets*/
Data EmpA;
Input First $ Gender $ EmpID;
datalines;
Togar 	M	121150
Kylie	F	121151
Birin	M	121152
;
Run;
Data EmpB;
Input EmpID Phone $16.;
datalines;
121150	+61(2)5555-1793
121151	+61(2)5555-1849
121152	+61(2)5555-1665
;
run;
proc print data=EmpB;
run;

data EmpAB;
	Merge EmpA EmpB; /*Merge replaces the set for side-by-side combining*/
	by EmpID; /*By statement variable must be within each data set*/
	          /*Usually need to sort by the 
	            same variable in each data set*/
Run;
proc print data=EmpAB;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Godzilla_Hat_0-1634158794763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64669i3DF2F63F844C08B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Godzilla_Hat_0-1634158794763.png" alt="Godzilla_Hat_0-1634158794763.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is my output data and I know it is incorrect. What should I change in my code ?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 21:00:43 GMT</pubDate>
    <dc:creator>Godzilla_Hat</dc:creator>
    <dc:date>2021-10-13T21:00:43Z</dc:date>
    <item>
      <title>What is wrong with my merging data set here ? What would be my solution on combing these 2 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774047#M31200</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;/*Example 7: Merging datasets*/
Data EmpA;
Input First $ Gender $ EmpID;
datalines;
Togar 	M	121150
Kylie	F	121151
Birin	M	121152
;
Run;
Data EmpB;
Input EmpID Phone $16.;
datalines;
121150	+61(2)5555-1793
121151	+61(2)5555-1849
121152	+61(2)5555-1665
;
run;
proc print data=EmpB;
run;

data EmpAB;
	Merge EmpA EmpB; /*Merge replaces the set for side-by-side combining*/
	by EmpID; /*By statement variable must be within each data set*/
	          /*Usually need to sort by the 
	            same variable in each data set*/
Run;
proc print data=EmpAB;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Godzilla_Hat_0-1634158794763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64669i3DF2F63F844C08B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Godzilla_Hat_0-1634158794763.png" alt="Godzilla_Hat_0-1634158794763.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is my output data and I know it is incorrect. What should I change in my code ?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 21:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774047#M31200</guid>
      <dc:creator>Godzilla_Hat</dc:creator>
      <dc:date>2021-10-13T21:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my merging data set here ? What would be my solution on combing these 2 datas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774048#M31201</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/397864"&gt;@Godzilla_Hat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/*Example 7: Merging datasets*/
Data EmpA;
Input First $ Gender $ EmpID;
datalines;
Togar 	M	121150
Kylie	F	121151
Birin	M	121152
;
Run;
Data EmpB;
Input EmpID Phone $16.;
datalines;
121150	+61(2)5555-1793
121151	+61(2)5555-1849
121152	+61(2)5555-1665
;
run;
proc print data=EmpB;
run;

data EmpAB;
	Merge EmpA EmpB; /*Merge replaces the set for side-by-side combining*/
	by EmpID; /*By statement variable must be within each data set*/
	          /*Usually need to sort by the 
	            same variable in each data set*/
Run;
proc print data=EmpAB;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Godzilla_Hat_0-1634158794763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64669i3DF2F63F844C08B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Godzilla_Hat_0-1634158794763.png" alt="Godzilla_Hat_0-1634158794763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is my output data and I know it is incorrect. What should I change in my code ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The code and generated data does not generate the result shown. The result you show means that you forced reading the Empid into the Gender, which typically means the data was read incorrectly, possibly incorrect use of column input instead of list.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 21:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774048#M31201</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-13T21:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my merging data set here ? What would be my solution on combing these 2 datas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774057#M31203</link>
      <description>&lt;P&gt;SAS expects to find blanks between the variables in the DATALINES section.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You used tabs, not blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use tabs, but then you would need to add an INFILE statement and an option to tell SAS you are using tabs instead of blanks to delimit your variables.&amp;nbsp; It might be easiest to re-type the data, using spaces in between your variables.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 22:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774057#M31203</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-10-13T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my merging data set here ? What would be my solution on combing these 2 datas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774069#M31204</link>
      <description>&lt;P&gt;Specify the delimiter appropriately, in this case a Tab as mentioned by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*Example 7: Merging datasets*/
Data EmpA;
&lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt;infile cards dlm='09'x;&lt;/STRONG&gt;&lt;/FONT&gt;
Input First $ Gender $ EmpID;
datalines;
Togar 	M	121150
Kylie	F	121151
Birin	M	121152
;
Run;
Data EmpB;
&lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt;infile cards dlm='09'x;&lt;/STRONG&gt;&lt;/FONT&gt;
Input EmpID Phone $16.;
datalines;
121150	+61(2)5555-1793
121151	+61(2)5555-1849
121152	+61(2)5555-1665
;
run;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/397864"&gt;@Godzilla_Hat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/*Example 7: Merging datasets*/
Data EmpA;
Input First $ Gender $ EmpID;
datalines;
Togar 	M	121150
Kylie	F	121151
Birin	M	121152
;
Run;
Data EmpB;
Input EmpID Phone $16.;
datalines;
121150	+61(2)5555-1793
121151	+61(2)5555-1849
121152	+61(2)5555-1665
;
run;
proc print data=EmpB;
run;

data EmpAB;
	Merge EmpA EmpB; /*Merge replaces the set for side-by-side combining*/
	by EmpID; /*By statement variable must be within each data set*/
	          /*Usually need to sort by the 
	            same variable in each data set*/
Run;
proc print data=EmpAB;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Godzilla_Hat_0-1634158794763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64669i3DF2F63F844C08B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Godzilla_Hat_0-1634158794763.png" alt="Godzilla_Hat_0-1634158794763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is my output data and I know it is incorrect. What should I change in my code ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 23:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774069#M31204</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-13T23:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my merging data set here ? What would be my solution on combing these 2 datas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774073#M31205</link>
      <description>&lt;P&gt;I seem to recall you had exactly the same problem in another of your posts - tabs between DATALINE fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are new to SAS I suggest you avoid using tabs in DATALINEs as they appear to be causing you confusion. The very fact that they are not visible in the SAS editor is the likely cause.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 00:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-wrong-with-my-merging-data-set-here-What-would-be-my/m-p/774073#M31205</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-10-14T00:01:50Z</dc:date>
    </item>
  </channel>
</rss>

