<?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 CSV files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313856#M68267</link>
    <description>&lt;P&gt;Still I'm not getting the desired output. There is no change in the output file after adding the if clause before put statement. My code is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have ("/sas/customer1.csv", "/sas/customer2.csv", "/sas/customer3.csv");
filename want '/sas/customer.csv';

data _null_;
	file want
	infile have
	input;
        if substr(_infile_,1,4) ne 'Name';
        put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Nov 2016 18:28:30 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2016-11-23T18:28:30Z</dc:date>
    <item>
      <title>Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312104#M67635</link>
      <description>&lt;P&gt;I've three different CSV files of same structure. Appreciate if someone tell me how to merge all those files into one CSV &amp;nbsp;file via SAS program.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 20:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312104#M67635</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-16T20:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312105#M67636</link>
      <description>&lt;P&gt;The answers is within the Programming 1 course.&lt;/P&gt;
&lt;P&gt;I assume you mean concatenate,not merge.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 20:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312105#M67636</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-16T20:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312107#M67637</link>
      <description>&lt;P&gt;The SAS documentation actually has a really good section on 'Combining Data'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest your review it. It helps if your terminology aligns with the rest of industry &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically a merge is adding data side by side and append is used to denote stacking data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, there are alway exceptions...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 20:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312107#M67637</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-16T20:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312109#M67639</link>
      <description>&lt;P&gt;You're right, need to&amp;nbsp;&lt;SPAN&gt;concatenate&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 20:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312109#M67639</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-16T20:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312247#M67699</link>
      <description>&lt;P&gt;You can combine multiple external files into one fileref:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename inpfile ("filename1","filename2","filename3");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2016 09:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312247#M67699</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-17T09:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312376#M67750</link>
      <description>&lt;P&gt;Thank you for the reply. However once again I need little help to accomplish this task.When I tried the following code, headers of each file is getting concatenated in the final output (want) file. I just wanted to combine values of each file with one header as headers are same across the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have ("/sas/customer1.csv", "/sas/customer2.csv", "/sas/customer3.csv");
filename want '/sas/customer.csv';

data _null_;
	file want
	infile have
	input;
		put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 16:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312376#M67750</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-17T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312387#M67757</link>
      <description>&lt;P&gt;You need to identify (with a proper substring) the header records and omit them with a subsetting if.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 16:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312387#M67757</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-17T16:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312399#M67765</link>
      <description>&lt;P&gt;I couldn't understand. Appriciate if you could provide some outline in terms of program to achieve this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assume I've the output file &amp;nbsp;as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="138"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="74"&gt;Name&lt;/TD&gt;
&lt;TD width="64"&gt;Age&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;James&lt;/TD&gt;
&lt;TD&gt;34&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Name&lt;/TD&gt;
&lt;TD&gt;Age&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Sachin&lt;/TD&gt;
&lt;TD&gt;51&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking for output like,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="138"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="74"&gt;Name&lt;/TD&gt;
&lt;TD width="64"&gt;Age&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;James&lt;/TD&gt;
&lt;TD&gt;34&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Sachin&lt;/TD&gt;
&lt;TD&gt;51&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any inputs you offer me.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 17:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312399#M67765</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-17T17:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312403#M67766</link>
      <description>&lt;H1 class="xis-title"&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Example 1: Import All CSV Files That Exist within a Directory&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#n0ctmldxf23ixtn1kqsoh5bsgmg8.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#n0ctmldxf23ixtn1kqsoh5bsgmg8.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="lia-link-navigation blog-article-link lia-link-disabled"&gt;How do I write a macro to...impor&lt;WBR /&gt;t multiple text files that have the same format?&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second example explicitly deals with multiple files, that have multiple headers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read through it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 17:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312403#M67766</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-17T17:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312431#M67778</link>
      <description>&lt;P&gt;Just add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if substr(_infile_,1,4) ne 'Name';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before the&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put _infile_;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2016 19:26:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312431#M67778</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-17T19:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312746#M67857</link>
      <description>&lt;P&gt;You want to skip reading the header row. This can be done in a data step with the EOV option and some additional coding.&lt;/P&gt;
&lt;P&gt;A very rough skeleton of the program would look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   infile "C:\Path\*.csv" delimiter=','  DSD lrecl=32767 firstobs=2  eov=skip missover;
   /*anything else you may want befor the input such as Informat statements*/
   input @; /*this reads in the "current" line and holds. This sets the value
              of the EOV (End Of file Variable) */
   if Skip then do;
      skip = 0;
   end;
   else do;
      input 
      /* input variable list*/
      ;
      /* any other code you may need*/
      output; /* explicitly write to the output set*/
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; The resetting of the variable Skip, my name nothing magical, is required otherwise you can end up in an infinite loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The example requires you to put the variable names and such code.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 22:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/312746#M67857</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-18T22:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313856#M68267</link>
      <description>&lt;P&gt;Still I'm not getting the desired output. There is no change in the output file after adding the if clause before put statement. My code is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have ("/sas/customer1.csv", "/sas/customer2.csv", "/sas/customer3.csv");
filename want '/sas/customer.csv';

data _null_;
	file want
	infile have
	input;
        if substr(_infile_,1,4) ne 'Name';
        put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 18:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313856#M68267</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-23T18:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313887#M68281</link>
      <description>&lt;P&gt;You're not inputting to a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest you work through my example step by step but utimately it's your choice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313887#M68281</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-23T20:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313895#M68282</link>
      <description>&lt;P&gt;The code you've posted will read the 3 .csv from source and write all the records except the ones having "Name" at the beginning of a line to a single output file named customer.csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code as such will work IF you add semicolons after "file want" and "infile have"....&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 21:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/313895#M68282</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-11-23T21:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314768#M68602</link>
      <description>&lt;P&gt;It is still not working after adding the semicolons in file and infile statements&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 09:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314768#M68602</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-28T09:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314769#M68603</link>
      <description>&lt;P&gt;Define "not working".&lt;/P&gt;
&lt;P&gt;If you get errors,&lt;/P&gt;
&lt;P&gt;SHOW.THE.LOG.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 09:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314769#M68603</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-28T09:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314778#M68604</link>
      <description>&lt;P&gt;I'm not getting any errors. Output is produced with too many headers as I've too many values/rows from each of the file. I'm looking for only one header as file structure is same across the files&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 10:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314778#M68604</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-28T10:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314779#M68605</link>
      <description>&lt;P&gt;Post your code. Did you use the EOV option as illustrated or another method?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not working means nothing, provide details of what is occurring.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 10:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314779#M68605</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-28T10:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314782#M68606</link>
      <description>&lt;P&gt;I've used the following code and it is produced customer.csv file with 3 headers and 3 rows of values as I've 1 record per file. I"m looking for 1 header and&amp;nbsp;&lt;SPAN&gt;3 rows of values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; have &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"/sas/customer1.csv"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"/sas/customer2.csv"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"/sas/customer3.csv"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; want &lt;SPAN class="token string"&gt;'/sas/customer.csv'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _null_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;file&lt;/SPAN&gt; want;
	&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; have;
	&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;substr&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;_infile_&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;ne&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Name'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; _infile_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 10:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314782#M68606</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-11-28T10:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merge CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314783#M68607</link>
      <description>&lt;P&gt;So, I did the following:&lt;/P&gt;
&lt;P&gt;File $HOME/sas/customer1.csv:&lt;/P&gt;
&lt;PRE&gt;Name,sales
Jack,5
Joe,3
Jill,4&lt;/PRE&gt;
&lt;P&gt;File $HOME/sas/customer2.csv:&lt;/P&gt;
&lt;PRE&gt;Name,sales
Frank,6
Richard,4
Britt,2
&lt;/PRE&gt;
&lt;P&gt;File $HOME/sas/customer3.csv:&lt;/P&gt;
&lt;PRE&gt;Name,sales
Bruce,8
William,4&lt;/PRE&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have ("$HOME/sas/customer1.csv","$HOME/sas/customer2.csv","$HOME/sas/customer3.csv");
filename want "$HOME/sas/customer.csv";

data _null_;
infile have;
file want;
input;
if (substr(_infile_,1,4)) ne 'Name';
put _infile_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Resulting file $HOME/sas/customer.csv:&lt;/P&gt;
&lt;PRE&gt;Jack,5
Joe,3
Jill,4
Frank,6
Richard,4
Britt,2
Bruce,8
William,4
&lt;/PRE&gt;
&lt;P&gt;As you see, the code works perfectly well with data as specified.&lt;/P&gt;
&lt;P&gt;Either you made an error copying the code or the data does not look as you described.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 10:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-CSV-files/m-p/314783#M68607</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-28T10:34:37Z</dc:date>
    </item>
  </channel>
</rss>

