<?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 data sets by using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589855#M168763</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203676"&gt;@liyongkai800&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks, that does save 1 to 3. However, the texts actually mean something in my original question, and it has more than three groups. Then I still need something like onedata:...... twentydata:;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What texts? Your original question doesn't reference any "texts".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean something related to the name of the contributing data set you can add that with the Indsname option:&lt;/P&gt;
&lt;PRE&gt;Data combine;
   set Onedata:  Twodata:Threedata: indsname=ds;
   source = ds;
run;&lt;/PRE&gt;
&lt;P&gt;DS would be a temporary variable that exists only for the duration of the data step. It holds the name of the data set the current record is from.&lt;/P&gt;
&lt;P&gt;I assigned the value to another variable so you could see it after the step ends. You could parse your set name for any processing you might need that is different based on the name.&lt;/P&gt;
&lt;P&gt;Or perhaps assign a custom format to the text to display considerably longer text then the variable would have.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 22:36:29 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-09-18T22:36:29Z</dc:date>
    <item>
      <title>Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589779#M168730</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say I have data sets: Onedata1, Onedata2,&amp;nbsp; Twodata1, Twodata2, Threedata1, Threedata2, which have the same structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can simply merge them like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data combine;&lt;/P&gt;&lt;P&gt;set&amp;nbsp;Onedata1 Onedata2&amp;nbsp; Twodata1 Twodata2 Threedata1 Threedata2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm wondering is there an alternative way to merge them, to make loops on one to three and 1 to 2, so that I don't need to list all of them after set statement. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 18:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589779#M168730</guid>
      <dc:creator>liyongkai800</dc:creator>
      <dc:date>2019-09-18T18:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589784#M168731</link>
      <description>&lt;P&gt;I find loops creating texts boring&lt;/P&gt;
&lt;P&gt;why not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 

Data combine;

set Onedata:  Twodata:Threedata:;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have just sets of 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 18:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589784#M168731</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-18T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589787#M168733</link>
      <description>Thanks, that does save 1 to 3. However, the texts actually mean something in my original question, and it has more than three groups. Then I still need something like onedata:...... twentydata:;</description>
      <pubDate>Wed, 18 Sep 2019 18:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589787#M168733</guid>
      <dc:creator>liyongkai800</dc:creator>
      <dc:date>2019-09-18T18:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589789#M168734</link>
      <description>&lt;P&gt;Okay&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203676"&gt;@liyongkai800&lt;/a&gt;&amp;nbsp; you do makes sense. If the texts are in a library, you could query dictionary tables and load the values in a macro var and call in the set statement. If there is a pattern in the names. the filtering can be easy. But either way, it's gonna be a tedious and not so cool.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do one thing, post a more "representative" sample of your names and somebody might have a better idea. Chill&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 19:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589789#M168734</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-18T19:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589855#M168763</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203676"&gt;@liyongkai800&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks, that does save 1 to 3. However, the texts actually mean something in my original question, and it has more than three groups. Then I still need something like onedata:...... twentydata:;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What texts? Your original question doesn't reference any "texts".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean something related to the name of the contributing data set you can add that with the Indsname option:&lt;/P&gt;
&lt;PRE&gt;Data combine;
   set Onedata:  Twodata:Threedata: indsname=ds;
   source = ds;
run;&lt;/PRE&gt;
&lt;P&gt;DS would be a temporary variable that exists only for the duration of the data step. It holds the name of the data set the current record is from.&lt;/P&gt;
&lt;P&gt;I assigned the value to another variable so you could see it after the step ends. You could parse your set name for any processing you might need that is different based on the name.&lt;/P&gt;
&lt;P&gt;Or perhaps assign a custom format to the text to display considerably longer text then the variable would have.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 22:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589855#M168763</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-18T22:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589858#M168765</link>
      <description>&lt;P&gt;Yes, you can do this with a macro or CALL EXECUTE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you need to be more specific about the problem. Are you talking about ALL of the data sets in a library, or some? If some, how would you identify the ones that are to be merged? Is all of this merging done one-to-one, or BY some variable?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 22:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/589858#M168765</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-18T22:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Merge data sets by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/590896#M169187</link>
      <description>Yes, dictionary.tables can be used to create a list to store all data sets. I missed some features in my question.</description>
      <pubDate>Mon, 23 Sep 2019 12:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-data-sets-by-using-macro/m-p/590896#M169187</guid>
      <dc:creator>liyongkai800</dc:creator>
      <dc:date>2019-09-23T12:58:57Z</dc:date>
    </item>
  </channel>
</rss>

