<?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: SAS help Merging Data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/704602#M216015</link>
    <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loop(skip=);
  %local i;
  %do i=1 %to 100 %by &amp;amp;skip.;
     WORK.ANOVARESULTS&amp;amp;i.
  %end;
%mend;

data RESULTS;
  set %loop(skip=9);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Dec 2020 01:44:13 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-12-09T01:44:13Z</dc:date>
    <item>
      <title>SAS help Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/704526#M216007</link>
      <description>&lt;P&gt;Hey All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was hoping that you could help me with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently running a macros, in which I am creating X number of datasets (code is below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO RunANOVA (Variable = , Number = );&lt;BR /&gt;ODS TRACE ON;&lt;BR /&gt;PROC ANOVA&lt;BR /&gt;DATA = Work.data&lt;BR /&gt;ORDER = INTERNAL;&lt;BR /&gt;CLASS StateCd;&lt;BR /&gt;MODEL &amp;amp;Variable = StateCd;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;BR /&gt;ODS TRACE OFF;&lt;/P&gt;&lt;P&gt;ODS OUTPUT OverallANOVA = WORK.ANOVAResults&amp;amp;Number&lt;BR /&gt;ModelANOVA = WORK.ModelResults&amp;amp;Number;&lt;/P&gt;&lt;P&gt;PROC ANOVA&lt;BR /&gt;DATA = Work.data&lt;BR /&gt;ORDER = INTERNAL;&lt;BR /&gt;CLASS StateCd;&lt;BR /&gt;MODEL &amp;amp;Variable = StateCd;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;DATA WORK.ANOVAResults&amp;amp;Number;&lt;BR /&gt;RETAIN Variable Dependent FValue ProbF;&lt;BR /&gt;SET WORK.&amp;amp;Number;&lt;BR /&gt;KEEP Variable Dependent FValue ProbF;&lt;BR /&gt;Variable = &amp;amp;Number;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;%MEND RunANOVA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can then merge all the datasets together using the following code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA work.ANOVAResults;&lt;BR /&gt;SET WORK.ANOVAResults:;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is that is there a way manipulate the Data step from the code above to&amp;nbsp;merge only every nth dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have a total of 100 datasets (HypRslt.ANOVAResults1-100) and I want to merge every 10th dataset. I know that I could use the following code below to get this done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA Work.ANOVAResults;&lt;BR /&gt;SET WORK.ANOVAResults10&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults20&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults30&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults40&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults50&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults60&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults70&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults80&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults90&lt;/P&gt;&lt;P&gt;WORK.ANOVAResults100;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I was wondering if there was a simpler way to code this, so that if I wanted to merge very 9th dataset instead of every 10th dataset, I could easily do this without having to write out the name of each dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could let me know if this is possible, or if you need more information, it would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/704526#M216007</guid>
      <dc:creator>tagawa_sas</dc:creator>
      <dc:date>2020-12-10T15:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS help Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/704602#M216015</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loop(skip=);
  %local i;
  %do i=1 %to 100 %by &amp;amp;skip.;
     WORK.ANOVARESULTS&amp;amp;i.
  %end;
%mend;

data RESULTS;
  set %loop(skip=9);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Dec 2020 01:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/704602#M216015</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-09T01:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS help Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/705085#M216215</link>
      <description>&lt;P&gt;Yes that is exactly what I needed. Did not think to do another macro&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-help-Merging-Data/m-p/705085#M216215</guid>
      <dc:creator>tagawa_sas</dc:creator>
      <dc:date>2020-12-10T15:05:09Z</dc:date>
    </item>
  </channel>
</rss>

