<?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: trying to concatenate 400 files using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127655#M26060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Each dataset is a subject data labelled alphanumerically in a random order. There is no pattern in the dataset names. &lt;/P&gt;&lt;P&gt;I have a list of the 400 names in a seperate dataset. I need to write a script which would do this&lt;/P&gt;&lt;P&gt;data=combineddata;&lt;/P&gt;&lt;P&gt;set ds1...ds400;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I use macro to call each of the file from the filename dataset and combine them together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 15:35:12 GMT</pubDate>
    <dc:creator>SN</dc:creator>
    <dc:date>2013-03-05T15:35:12Z</dc:date>
    <item>
      <title>trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127650#M26055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 400 files to merge as one dataset. They have the same columns, but are of different subjects. So every line in each of the data set needs to be included.&lt;/P&gt;&lt;P&gt;not sure if the "merge by" would work here. Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127650#M26055</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-03-05T15:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127651#M26056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might not need macro at all.&amp;nbsp; If your files are text you could read them all in one datastep using wildcards in the infile statement (at least on Windows).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127651#M26056</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-05T15:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127652#M26057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not clear that "MERGE" is the way to go. I think SET makes more sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are these 400 files SAS data sets, or external files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on how the files are named, and what type of files you are working with, we can probably provide more specific advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127652#M26057</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-03-05T15:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127653#M26058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;they are as SAS datasets in a lib ; Number of rows varies from 1&amp;nbsp; to 50&amp;nbsp; rows&amp;nbsp; in the datasets. Finally, after combining the datasets, I would need to run stats analysis on it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127653#M26058</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-03-05T15:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127654#M26059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I said "depending on how the files are named"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You didn't address this. Are they named sequentially, or by some identifier, or otherwise? What are some of the names?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127654#M26059</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-03-05T15:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127655#M26060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Each dataset is a subject data labelled alphanumerically in a random order. There is no pattern in the dataset names. &lt;/P&gt;&lt;P&gt;I have a list of the 400 names in a seperate dataset. I need to write a script which would do this&lt;/P&gt;&lt;P&gt;data=combineddata;&lt;/P&gt;&lt;P&gt;set ds1...ds400;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I use macro to call each of the file from the filename dataset and combine them together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127655#M26060</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-03-05T15:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127656#M26061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a macro variable &amp;amp;names that contains all the data set names, replace yourlibnamegoeshere with the actual name of the library, all in UPPER CASE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct memname into :names separated by ' ' from sashelp.vtable where libname="yourlibnamegoeshere";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then concatenate all data sets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;names;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127656#M26061</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-03-05T15:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127657#M26062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks much. this should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am currently getting an error for most of the variables&lt;/P&gt;&lt;P&gt;ERROR: Variable SBP has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;ERROR: Variable DBP has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably the&amp;nbsp; way forward is to check all the files for the variable type and run this code again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127657#M26062</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-03-05T16:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127658#M26063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks much. The code worked. I found a couple of empty files which gave an error as above. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127658#M26063</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-03-07T16:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: trying to concatenate 400 files using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127659#M26064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With 400 datasets on the SET statement you may want to look at the SET statement documentation concerning the OPEN=DEFER option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 15:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-concatenate-400-files-using-macro/m-p/127659#M26064</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-03-08T15:31:51Z</dc:date>
    </item>
  </channel>
</rss>

