<?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: Processing all the files from a folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389674#M93443</link>
    <description>&lt;P&gt;I am not going to pretend to get what the "insect" coding is doing.&lt;/P&gt;
&lt;P&gt;You might want to take a look at this example and see how close it gets to your 2 and 3 requirements.&lt;/P&gt;
&lt;P&gt;Note that reading from the same folder with the same file format into a single data set is very simple when header rows are not involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   length file fn $ 100;
  infile "C:\Users\tebert\Desktop\Data_Folder\*.txt" lrecl=1000 dsd missover dlm=',' filename=fn;
  informat line $100. var1-var10 best16.;
  input line
        / var1-var10;
  file=fn;
run;&lt;/PRE&gt;
&lt;P&gt;The filename option on the INFILE statement keeps track of the name of the current file read but is temporary (it will not be added to the output data set) so you have to create another variable to save the value in. Since the path + file is more than 8 characters you want to set a length for the filename and permanent variable BEFORE it is referenced the first time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The / in the input is to read to two line structure in to a single record. The dlm=',' is because with the first line in quotes it is easy to read as comma delimited as the first line will terminate with the end of line character after the second quote.&lt;/P&gt;
&lt;P&gt;I have no idea why you were reading the data into character variables. I you need that then set the informat accordingly.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2017 21:28:21 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-08-21T21:28:21Z</dc:date>
    <item>
      <title>Processing all the files from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389667#M93439</link>
      <description>&lt;P&gt;I am using Enterprise Guide 7.4 running SAS 9.4 under Windows 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem: I have hundreds of files with the same format (I'll attach three examples). There is a line of text alternating with a line of numbers. I want to read all the files in a folder. Each file needs to be reorganized by making the text string a new variable paired with the number string. The name of each file is also added for each row of data in the data file. The results from all files are appended and saved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This example comes from &lt;A href="http://support.sas.com/kb/41/880.html" target="_blank"&gt;http://support.sas.com/kb/41/880.html&lt;/A&gt;, with minor modifications.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DIRLIST &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;pipe&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'dir "C:\Users\tebert\Desktop\Data_Folder\*.txt" /b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dirlist ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dirlist &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;200&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;truncover&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; file_name &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$100.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dirlist &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=end;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;count+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'read'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||put(count,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;-l),cats(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'C:\Users\tebert\Desktop\Data_Folder\'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,file_name));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'dset'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||put(count,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;-l),scan(file_name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'.'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; end &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'max'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,count);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;mprint&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;symbolgen&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;readin&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;max;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;&amp;amp;dset&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;infile &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;&amp;amp;read&amp;amp;i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; lrecl=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; truncover dsd missover;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;input var1 $ var2 $ var3 $ var4 $ var5 $ var6 $ var7 $ var8 $ var9 $ var10 $;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; readin;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;readin&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;It runs, but I have three questions:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;1) I would like to run the attached macro on each file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;2) The program reads each file saved in dirlist. I would like to have the file name added to each row of data in the file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;3) I would like to append all of the files to make one data file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Here is the macro:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%Macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;Manip&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Data one; set one;&lt;/P&gt;&lt;P&gt;retain insectno2;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if insectno2&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; then insectno2=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;insectno2=insectno2+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Data two three; set one;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if mod(insectno2,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) eq &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; then output two;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if mod(insectno2,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) eq &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; then output three;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Data two; set two; drop Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 insectno2;&lt;/P&gt;&lt;P&gt;Data two; set two;&lt;/P&gt;&lt;P&gt;retain insectno2;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if insectno2&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; then insectno2=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;insectno2=insectno2+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data three; set three;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;var9=var8; var8=var7; var7=var6; var6=var5; var5=var4; var4=var3; var3=var2; var2=var1; var1=var1; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/*Use "waveform;" in place of "var1;" to switch to TBF values.*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data three; set three; drop waveform insectno2;&lt;/P&gt;&lt;P&gt;data three; set three;&lt;/P&gt;&lt;P&gt;retain insectno2;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if insectno2&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; then insectno2=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;insectno2=insectno2+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data two; set two three; merge two three; by insectno2;&lt;/P&gt;&lt;P&gt;data two; set two; drop Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you for your help.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Tim&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 20:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389667#M93439</guid>
      <dc:creator>tebert</dc:creator>
      <dc:date>2017-08-21T20:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Processing all the files from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389672#M93442</link>
      <description>&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;See this post on how to modify your current code to create an automated process to read all in at once.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 21:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389672#M93442</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-21T21:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Processing all the files from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389674#M93443</link>
      <description>&lt;P&gt;I am not going to pretend to get what the "insect" coding is doing.&lt;/P&gt;
&lt;P&gt;You might want to take a look at this example and see how close it gets to your 2 and 3 requirements.&lt;/P&gt;
&lt;P&gt;Note that reading from the same folder with the same file format into a single data set is very simple when header rows are not involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   length file fn $ 100;
  infile "C:\Users\tebert\Desktop\Data_Folder\*.txt" lrecl=1000 dsd missover dlm=',' filename=fn;
  informat line $100. var1-var10 best16.;
  input line
        / var1-var10;
  file=fn;
run;&lt;/PRE&gt;
&lt;P&gt;The filename option on the INFILE statement keeps track of the name of the current file read but is temporary (it will not be added to the output data set) so you have to create another variable to save the value in. Since the path + file is more than 8 characters you want to set a length for the filename and permanent variable BEFORE it is referenced the first time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The / in the input is to read to two line structure in to a single record. The dlm=',' is because with the first line in quotes it is easy to read as comma delimited as the first line will terminate with the end of line character after the second quote.&lt;/P&gt;
&lt;P&gt;I have no idea why you were reading the data into character variables. I you need that then set the informat accordingly.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 21:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389674#M93443</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-21T21:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Processing all the files from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389701#M93446</link>
      <description>Thank you. This collapsed a somewhat convoluted program down into a few lines. The old program read the first variable as character because that was the first value. The other variables are then missing. The next line is read using the same format. Alternate lines are moved to two different data sets. Set1 has the character variable, Set2 has the numeric values. The sets are then merged. Your solution is much better. Thank you for describing how the program works. Awesome.</description>
      <pubDate>Tue, 22 Aug 2017 02:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Processing-all-the-files-from-a-folder/m-p/389701#M93446</guid>
      <dc:creator>tebert</dc:creator>
      <dc:date>2017-08-22T02:31:46Z</dc:date>
    </item>
  </channel>
</rss>

