<?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: How do I merge five permanent sas data sets? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501007#M133523</link>
    <description>&lt;P&gt;A bit simplistic, but in general,&lt;/P&gt;
&lt;P&gt;SET appends data sets - so when you're trying to add rows to a data set.&lt;/P&gt;
&lt;P&gt;MERGE combines data sets side by side - so you add columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're doing both which does not seem correct. Without more details though not sure we can help you here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226541"&gt;@JUMMY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have five permanent sas data sets I want to merge together by the ID. The data sets are Y(5 variables), YY(12 variables), YYY(47 variables), YYYY(36 variables) and YYYYY(24 variables). Some of the variables start with the letter "i" and needs to be formatted using the indicators (1='yes' and '0'=no) and gender variable - female (1='yes', 0='no'). Here is my sas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname in "E:\locationofdata";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data raw;&lt;/P&gt;
&lt;P&gt;set in.Y in.YY in.YYY in.YYYY in.YYYYY;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=raw;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=raw;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data merge;&lt;/P&gt;
&lt;P&gt;merge Y YY YYY YYYY YYYYY;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data =merge;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the sas data step right? How do I format to include the indicators as stated above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 01:41:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-03T01:41:08Z</dc:date>
    <item>
      <title>How do I merge five permanent sas data sets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/500995#M133512</link>
      <description>&lt;P&gt;I have five permanent sas data sets I want to merge together by the ID. The data sets are Y(5 variables), YY(12 variables), YYY(47 variables), YYYY(36 variables) and YYYYY(24 variables). Some of the variables start with the letter "i" and needs to be formatted using the indicators (1='yes' and '0'=no) and gender variable - female (1='yes', 0='no'). Here is my sas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Libname in "E:\locationofdata";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data raw;&lt;/P&gt;&lt;P&gt;set in.Y in.YY in.YYY in.YYYY in.YYYYY;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=raw;&lt;/P&gt;&lt;P&gt;by ID;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=raw;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data merge;&lt;/P&gt;&lt;P&gt;merge Y YY YYY YYYY YYYYY;&lt;/P&gt;&lt;P&gt;by ID;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data =merge;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the sas data step right? How do I format to include the indicators as stated above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 23:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/500995#M133512</guid>
      <dc:creator>JUMMY</dc:creator>
      <dc:date>2018-10-02T23:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge five permanent sas data sets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501000#M133516</link>
      <description>&lt;P&gt;Your two data steps are radically different, and we have no idea what result you want.&lt;/P&gt;
&lt;P&gt;Please post a small example of BEFORE and AFTER data.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;How to convert datasets to data steps&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting" target="_blank"&gt;How to post code&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501000#M133516</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-03T01:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge five permanent sas data sets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501004#M133520</link>
      <description>&lt;P&gt;Agreeing with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;, you really have not described the problem.&amp;nbsp; You say you want to merge permanent data sets, but use a SET statement to accomplish that.&amp;nbsp; When you finally get around to using a MERGE statement, you refer to data sets that don't exist.&amp;nbsp; You absolutely will have to clarify what your objective is.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501004#M133520</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-03T01:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge five permanent sas data sets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501007#M133523</link>
      <description>&lt;P&gt;A bit simplistic, but in general,&lt;/P&gt;
&lt;P&gt;SET appends data sets - so when you're trying to add rows to a data set.&lt;/P&gt;
&lt;P&gt;MERGE combines data sets side by side - so you add columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're doing both which does not seem correct. Without more details though not sure we can help you here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226541"&gt;@JUMMY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have five permanent sas data sets I want to merge together by the ID. The data sets are Y(5 variables), YY(12 variables), YYY(47 variables), YYYY(36 variables) and YYYYY(24 variables). Some of the variables start with the letter "i" and needs to be formatted using the indicators (1='yes' and '0'=no) and gender variable - female (1='yes', 0='no'). Here is my sas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname in "E:\locationofdata";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data raw;&lt;/P&gt;
&lt;P&gt;set in.Y in.YY in.YYY in.YYYY in.YYYYY;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=raw;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=raw;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data merge;&lt;/P&gt;
&lt;P&gt;merge Y YY YYY YYYY YYYYY;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data =merge;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the sas data step right? How do I format to include the indicators as stated above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501007#M133523</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-03T01:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge five permanent sas data sets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501215#M133610</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226541"&gt;@JUMMY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have five permanent sas data sets I want to merge together by the ID. The data sets are Y(5 variables), YY(12 variables), YYY(47 variables), YYYY(36 variables) and YYYYY(24 variables). Some of the variables start with the letter "i" and needs to be formatted using the indicators (1='yes' and '0'=no) and gender variable - female (1='yes', 0='no'). Here is my sas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname in "E:\locationofdata";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data raw;&lt;/P&gt;
&lt;P&gt;set in.Y in.YY in.YYY in.YYYY in.YYYYY;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=raw;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=raw;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data merge;&lt;/P&gt;
&lt;P&gt;merge Y YY YYY YYYY YYYYY;&lt;/P&gt;
&lt;P&gt;by ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data =merge;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the sas data step right? How do I format to include the indicators as stated above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What indicators? You did not use any.&lt;/P&gt;
&lt;P&gt;Are the names of the data sets involved n two different libraries?: in.Y&amp;nbsp; would be a dataset belonging to the IN library and Y to WORK library. So merge Y YY YYY YYYY YYYYY; refers to different data sets&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 17:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-merge-five-permanent-sas-data-sets/m-p/501215#M133610</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-03T17:11:02Z</dc:date>
    </item>
  </channel>
</rss>

