<?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 Combining Multiple Text Files without Formatting in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264858#M7302</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with Daily data which comes in a Text File. The files have a row for each observation and are formatted in based on character length. So each row has the same length in terms of characters and using infile I am able to seperate the rows into distinct columns based on the position of the characters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would like to combine these files into weekly or monthly files without disturbing the formmating of these files. All I would like to do is have SAS read Files A, B, C, etc. and append them one on top of the other and then resave this file as a text file without having manipulated or formatted the files one bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the point and click method to import the files, I am able to get them into SAS without manipulating the files but I cannot figure out how to code the system to read these files without it wanting some sort of formating to be done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Garrett&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2016 18:42:56 GMT</pubDate>
    <dc:creator>SmcGarrett</dc:creator>
    <dc:date>2016-04-19T18:42:56Z</dc:date>
    <item>
      <title>Combining Multiple Text Files without Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264858#M7302</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with Daily data which comes in a Text File. The files have a row for each observation and are formatted in based on character length. So each row has the same length in terms of characters and using infile I am able to seperate the rows into distinct columns based on the position of the characters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would like to combine these files into weekly or monthly files without disturbing the formmating of these files. All I would like to do is have SAS read Files A, B, C, etc. and append them one on top of the other and then resave this file as a text file without having manipulated or formatted the files one bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the point and click method to import the files, I am able to get them into SAS without manipulating the files but I cannot figure out how to code the system to read these files without it wanting some sort of formating to be done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Garrett&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 18:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264858#M7302</guid>
      <dc:creator>SmcGarrett</dc:creator>
      <dc:date>2016-04-19T18:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Text Files without Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264879#M7303</link>
      <description>&lt;P&gt;The result you are asking for, appending files could well be better done with operating system tools but if your really need a SAS solution something like this:&lt;/P&gt;
&lt;P&gt;First a FILENAME statement to reference your files. If the files have a name that matches your sort order that you want for output you might be able to use wildcard but this is the base idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filename input ("C:\path\Firstfile.txt" "C:\path\Secondfile.txt" ...);&amp;nbsp; repeat the file names&lt;/P&gt;
&lt;P&gt;IF all the files are in the same folder you might be able to use:&lt;/P&gt;
&lt;P&gt;Filename input "C:\path\*.txt";&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   infile input lrecl=10000;
   file "C:\Outpat\COMBINED.txt" lrecl=10000;
   input;
   put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the Lrecl needs to be as long as the longest line you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: This does not create a SAS dataset, just reads lines and then writes them out again.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 19:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264879#M7303</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-19T19:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Multiple Text Files without Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264920#M7306</link>
      <description>&lt;P&gt;This question was asked last week by someone else and I posted an OS based solution.&lt;/P&gt;
&lt;P&gt;If UNIX command is cat, I can't recall Windows command but you should be able to find it via a search.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 22:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Combining-Multiple-Text-Files-without-Formatting/m-p/264920#M7306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-19T22:04:53Z</dc:date>
    </item>
  </channel>
</rss>

