<?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: Multiple csv files in one SAS data set instead of multiple data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344796#M79263</link>
    <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is expected in *Place&amp;nbsp;input code here? I entered a few logic but it says expecting a&amp;nbsp;@.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Akhilesh&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 procnames"&gt;data&lt;/SPAN&gt; import_all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*make sure variables to store file name are long enough;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; txt_file_name &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;256&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*keep file name from record to record;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;retain&lt;/SPAN&gt; txt_file_name&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Use wildcard in input;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"Path\*.txt"&lt;/SPAN&gt; eov&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;eov &lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; truncover&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Input first record and hold line;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&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 comment"&gt;*Check if this is the first record or the first record in a new file;&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;*If it is, replace the filename with the new file name and move to next line;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;eq&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; or eov &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
txt_file_name &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt;&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 string"&gt;"\"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
eov&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Otherwise  go to the import step and read the files;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Place input code here;&lt;/SPAN&gt;
 
&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, 27 Mar 2017 21:02:24 GMT</pubDate>
    <dc:creator>akhileshJoshi</dc:creator>
    <dc:date>2017-03-27T21:02:24Z</dc:date>
    <item>
      <title>Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344761#M79249</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that imports multiple csv files in different SAS data tables. If I wish to have only one large data table instead of different tables, what should I change in my code? I tried a few things but didnt work. &amp;nbsp;Please advise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let path=D:\My_SAS_Projects;&lt;BR /&gt;filename folder "&amp;amp;path\Data.";&lt;BR /&gt;libname c 'C:\Temp';&lt;BR /&gt;options validmemname=extend;&lt;/P&gt;&lt;P&gt;data FilesInFolder;&lt;BR /&gt;length Line 8 File $300;&lt;BR /&gt;List = dopen('folder');&lt;BR /&gt;do Line = 1 to dnum(List);&lt;BR /&gt;File = trim(dread(List,Line));&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;drop list line;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;BR /&gt;set FilesInFolder end=final;&lt;BR /&gt;call symput(cats('File', _N_), trim(File));&lt;BR /&gt;call symput(cats('Name', _N_), trim(nliteral(substr(File,1,min(32, length(File)-4)))));&lt;BR /&gt;if final then call symputx(trim('Total'), _N_);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro Iteration;&lt;BR /&gt;%do i = 1 %to &amp;amp;Total;&lt;BR /&gt;proc import datafile="&amp;amp;path\Data\&amp;amp;&amp;amp;File&amp;amp;i"&lt;BR /&gt;out= c.&amp;amp;&amp;amp;name&amp;amp;i&lt;BR /&gt;dbms=csv&lt;BR /&gt;replace;&lt;BR /&gt;getnames=yes;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend Iteration;&lt;BR /&gt;&lt;BR /&gt;%Iteration&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 20:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344761#M79249</guid>
      <dc:creator>akhileshJoshi</dc:creator>
      <dc:date>2017-03-27T20:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344763#M79251</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;</description>
      <pubDate>Mon, 27 Mar 2017 20:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344763#M79251</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-27T20:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344770#M79252</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already seen this thread. But I am already using the Macro I pasted above in my code. So, wanted to know if the macro itself could be modified instead of writing a new logic.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 20:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344770#M79252</guid>
      <dc:creator>akhileshJoshi</dc:creator>
      <dc:date>2017-03-27T20:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344776#M79254</link>
      <description>&lt;P&gt;Yes, but you're likely to run into errors with that method. PROC IMPORT is a guessing procedure, it guesses at types. At some point it will guess incorrectly and read a variable in with incorrect type/format. When you try to append you'll generate an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to modify your macro, you need at least two extra steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Add a&amp;nbsp;PROC APPEND after the import and append the data. Note that the base data does not need to pre-exist for first iteration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Drop the table after you append it so it's not laying around.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 (optional). Check if master table already exists and if it does either empty or delete the table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 20:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344776#M79254</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-27T20:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344796#M79263</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is expected in *Place&amp;nbsp;input code here? I entered a few logic but it says expecting a&amp;nbsp;@.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Akhilesh&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 procnames"&gt;data&lt;/SPAN&gt; import_all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*make sure variables to store file name are long enough;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; txt_file_name &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;256&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*keep file name from record to record;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;retain&lt;/SPAN&gt; txt_file_name&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Use wildcard in input;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"Path\*.txt"&lt;/SPAN&gt; eov&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;eov &lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; truncover&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Input first record and hold line;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&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 comment"&gt;*Check if this is the first record or the first record in a new file;&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;*If it is, replace the filename with the new file name and move to next line;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;eq&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; or eov &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
txt_file_name &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt;&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 string"&gt;"\"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
eov&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Otherwise  go to the import step and read the files;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;*Place input code here;&lt;/SPAN&gt;
 
&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, 27 Mar 2017 21:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344796#M79263</guid>
      <dc:creator>akhileshJoshi</dc:creator>
      <dc:date>2017-03-27T21:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344800#M79266</link>
      <description>&lt;P&gt;Post the data step code to read a single file correctly and I'll show you how to map it to the data step solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have the code, run a single proc import and get the code from the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 21:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/344800#M79266</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-27T21:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/345034#M79337</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find below the data step code to read a single&amp;nbsp;file correctly. Please guide how I can use it to map to the data step solution for multiple csv's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data AK.DB4;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;infile 'D:\Raw_Data\RMS_Transposed_Canvass_History\RMS_CompetitorRate_03242017.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/P&gt;&lt;P&gt;informat PickupLocationCode $3.;&lt;BR /&gt;&lt;BR /&gt;informat PickupLocationCode $3.;&lt;BR /&gt;&lt;BR /&gt;informat CarClass $1. ;&lt;BR /&gt;&lt;BR /&gt;informat PickupDate anydtdtm40. ;&lt;BR /&gt;&lt;BR /&gt;informat ReturnDate anydtdtm40. ;&lt;BR /&gt;&lt;BR /&gt;informat PricingSegmentId $3. ;&lt;BR /&gt;&lt;BR /&gt;informat ShopDate anydtdtm40. ;&lt;BR /&gt;&lt;BR /&gt;informat LengthOfRent best32. ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;informat PointOfSaleCountryCode $2. ;&lt;BR /&gt;&lt;BR /&gt;informat CategoryCode $1. ;&lt;BR /&gt;&lt;BR /&gt;informat RealTimeCanvasCode $1. ;&lt;BR /&gt;&lt;BR /&gt;informat Rate_Type $4. ;&lt;BR /&gt;&lt;BR /&gt;informat AC $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AD $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AL $11. ;&lt;BR /&gt;&lt;BR /&gt;informat EP $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ET $11. ;&lt;BR /&gt;&lt;BR /&gt;informat EY $1. ;&lt;BR /&gt;&lt;BR /&gt;informat EZ $1. ;&lt;BR /&gt;&lt;BR /&gt;informat FX $1. ;&lt;BR /&gt;&lt;BR /&gt;informat MW $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NC $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NE $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NU $1. ;&lt;BR /&gt;&lt;BR /&gt;informat PC $1. ;&lt;BR /&gt;&lt;BR /&gt;informat PR $1. ;&lt;BR /&gt;&lt;BR /&gt;informat RW $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SC $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SV $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SX $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ZA $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ZD $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZE $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZI $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZL $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZR $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZT $11. ;&lt;BR /&gt;&lt;BR /&gt;informat VR $1. ;&lt;BR /&gt;&lt;BR /&gt;informat RE $1. ;&lt;BR /&gt;&lt;BR /&gt;informat MX $1. ;&lt;BR /&gt;&lt;BR /&gt;informat FF $1. ;&lt;BR /&gt;&lt;BR /&gt;informat XX $1. ;&lt;BR /&gt;&lt;BR /&gt;informat WH $1. ;&lt;BR /&gt;&lt;BR /&gt;informat GM $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AX $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SL $1. ;&lt;BR /&gt;&lt;BR /&gt;informat MV $1. ;&lt;BR /&gt;&lt;BR /&gt;informat DS $1. ;&lt;BR /&gt;&lt;BR /&gt;informat GI $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AD_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat AL_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat EP_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ET_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat EY_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat EZ_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat FX_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat MW_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NE_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat NU_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat PC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat PR_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat RW_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SV_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat SX_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ZA_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;informat ZD_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZE_EstTotal $11. ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;informat ZI_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZL_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZR_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;informat ZT_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format PickupLocationCode $3. ;&lt;BR /&gt;&lt;BR /&gt;format ReturnLocationCode $3. ;&lt;BR /&gt;&lt;BR /&gt;format CarClass $1. ;&lt;BR /&gt;&lt;BR /&gt;format PickupDate datetime. ;&lt;BR /&gt;&lt;BR /&gt;format ReturnDate datetime. ;&lt;BR /&gt;&lt;BR /&gt;format PricingSegmentId $3. ;&lt;BR /&gt;&lt;BR /&gt;format ShopDate datetime. ;&lt;BR /&gt;&lt;BR /&gt;format LengthOfRent best12. ;&lt;BR /&gt;&lt;BR /&gt;format PlanCode $1. ;&lt;BR /&gt;&lt;BR /&gt;format PointOfSaleCountryCode $2. ;&lt;BR /&gt;&lt;BR /&gt;format CategoryCode $1. ;&lt;BR /&gt;&lt;BR /&gt;format RealTimeCanvasCode $1. ;&lt;BR /&gt;&lt;BR /&gt;format Rate_Type $4. ;&lt;BR /&gt;&lt;BR /&gt;format AC $1. ;&lt;BR /&gt;&lt;BR /&gt;format AD $1. ;&lt;BR /&gt;&lt;BR /&gt;format AL $11. ;&lt;BR /&gt;&lt;BR /&gt;format EP $1. ;&lt;BR /&gt;&lt;BR /&gt;format ET $11. ;&lt;BR /&gt;&lt;BR /&gt;format EY $1. ;&lt;BR /&gt;&lt;BR /&gt;format EZ $1. ;&lt;BR /&gt;&lt;BR /&gt;format FX $1. ;&lt;BR /&gt;&lt;BR /&gt;format MW $1. ;&lt;BR /&gt;&lt;BR /&gt;format NC $1. ;&lt;BR /&gt;&lt;BR /&gt;format NE $1. ;&lt;BR /&gt;&lt;BR /&gt;format NU $1. ;&lt;BR /&gt;&lt;BR /&gt;format PC $1. ;&lt;BR /&gt;&lt;BR /&gt;format PR $1. ;&lt;BR /&gt;&lt;BR /&gt;format RW $1. ;&lt;BR /&gt;&lt;BR /&gt;format SC $1. ;&lt;BR /&gt;&lt;BR /&gt;format SV $1. ;&lt;BR /&gt;&lt;BR /&gt;format SX $1. ;&lt;BR /&gt;&lt;BR /&gt;format ZA $1. ;&lt;BR /&gt;&lt;BR /&gt;format ZD $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZE $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZI $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZL $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZR $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZT $11. ;&lt;BR /&gt;&lt;BR /&gt;format VR $1. ;&lt;BR /&gt;&lt;BR /&gt;format RE $1. ;&lt;BR /&gt;&lt;BR /&gt;format MX $1. ;&lt;BR /&gt;&lt;BR /&gt;format FF $1. ;&lt;BR /&gt;&lt;BR /&gt;format XX $1. ;&lt;BR /&gt;&lt;BR /&gt;format WH $1. ;&lt;BR /&gt;&lt;BR /&gt;format GM $1. ;&lt;BR /&gt;&lt;BR /&gt;format AX $1. ;&lt;BR /&gt;&lt;BR /&gt;format SL $1. ;&lt;BR /&gt;&lt;BR /&gt;format MV $1. ;&lt;BR /&gt;&lt;BR /&gt;format DS $1. ;&lt;BR /&gt;&lt;BR /&gt;format GI $1. ;&lt;BR /&gt;&lt;BR /&gt;format AC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format AD_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format AL_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format EP_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format ET_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format EY_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format EZ_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format FX_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format MW_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format NC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format NE_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format NU_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format PC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format PR_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format RW_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format SC_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format SV_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format SX_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format ZA_EstTotal $1. ;&lt;BR /&gt;&lt;BR /&gt;format ZD_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZE_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZI_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZL_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZR_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;format ZT_EstTotal $11. ;&lt;BR /&gt;&lt;BR /&gt;input&lt;BR /&gt;&lt;BR /&gt;PickupLocationCode $&lt;BR /&gt;&lt;BR /&gt;ReturnLocationCode $&lt;BR /&gt;&lt;BR /&gt;CarClass $&lt;BR /&gt;&lt;BR /&gt;PickupDate&lt;BR /&gt;&lt;BR /&gt;ReturnDate&lt;BR /&gt;&lt;BR /&gt;PricingSegmentId $&lt;BR /&gt;&lt;BR /&gt;ShopDate&lt;BR /&gt;&lt;BR /&gt;LengthOfRent&lt;BR /&gt;&lt;BR /&gt;PlanCode $&lt;BR /&gt;&lt;BR /&gt;PointOfSaleCountryCode $&lt;BR /&gt;&lt;BR /&gt;CategoryCode $&lt;BR /&gt;&lt;BR /&gt;RealTimeCanvasCode $&lt;BR /&gt;&lt;BR /&gt;Rate_Type $&lt;BR /&gt;&lt;BR /&gt;AC $&lt;BR /&gt;&lt;BR /&gt;AD $&lt;BR /&gt;&lt;BR /&gt;AL $&lt;BR /&gt;&lt;BR /&gt;EP $&lt;BR /&gt;&lt;BR /&gt;ET $&lt;BR /&gt;&lt;BR /&gt;EY $&lt;BR /&gt;&lt;BR /&gt;EZ $&lt;BR /&gt;&lt;BR /&gt;FX $&lt;BR /&gt;&lt;BR /&gt;MW $&lt;BR /&gt;&lt;BR /&gt;NC $&lt;BR /&gt;&lt;BR /&gt;NE $&lt;BR /&gt;&lt;BR /&gt;NU $&lt;BR /&gt;&lt;BR /&gt;PC $&lt;BR /&gt;&lt;BR /&gt;PR $&lt;BR /&gt;&lt;BR /&gt;RW $&lt;BR /&gt;&lt;BR /&gt;SC $&lt;BR /&gt;&lt;BR /&gt;SV $&lt;BR /&gt;&lt;BR /&gt;SX $&lt;BR /&gt;&lt;BR /&gt;ZA $&lt;BR /&gt;&lt;BR /&gt;ZD $&lt;BR /&gt;&lt;BR /&gt;ZI $&lt;BR /&gt;&lt;BR /&gt;ZL $&lt;BR /&gt;&lt;BR /&gt;ZR $&lt;BR /&gt;&lt;BR /&gt;ZT $&lt;BR /&gt;&lt;BR /&gt;VR $&lt;BR /&gt;&lt;BR /&gt;RE $&lt;BR /&gt;&lt;BR /&gt;MX $&lt;BR /&gt;&lt;BR /&gt;FF $&lt;BR /&gt;&lt;BR /&gt;XX $&lt;BR /&gt;&lt;BR /&gt;WH $&lt;BR /&gt;&lt;BR /&gt;GM $&lt;BR /&gt;&lt;BR /&gt;AX $&lt;BR /&gt;&lt;BR /&gt;SL $&lt;BR /&gt;&lt;BR /&gt;MV $&lt;BR /&gt;&lt;BR /&gt;DS $&lt;BR /&gt;&lt;BR /&gt;GI $&lt;BR /&gt;&lt;BR /&gt;AC_EstTotal $&lt;BR /&gt;&lt;BR /&gt;AD_EstTotal $&lt;BR /&gt;&lt;BR /&gt;AL_EstTotal $&lt;BR /&gt;&lt;BR /&gt;EP_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ET_EstTotal $&lt;BR /&gt;&lt;BR /&gt;EY_EstTotal $&lt;BR /&gt;&lt;BR /&gt;EZ_EstTotal $&lt;BR /&gt;&lt;BR /&gt;FX_EstTotal $&lt;BR /&gt;&lt;BR /&gt;MW_EstTotal $&lt;BR /&gt;&lt;BR /&gt;NC_EstTotal $&lt;BR /&gt;&lt;BR /&gt;NE_EstTotal $&lt;BR /&gt;&lt;BR /&gt;NU_EstTotal $&lt;BR /&gt;&lt;BR /&gt;PC_EstTotal $&lt;BR /&gt;&lt;BR /&gt;PR_EstTotal $&lt;BR /&gt;&lt;BR /&gt;RW_EstTotal $&lt;BR /&gt;&lt;BR /&gt;SC_EstTotal $&lt;BR /&gt;&lt;BR /&gt;SV_EstTotal $&lt;BR /&gt;&lt;BR /&gt;SX_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZA_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZD_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZE_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZI_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZL_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZR_EstTotal $&lt;BR /&gt;&lt;BR /&gt;ZT_EstTotal $;&lt;BR /&gt;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/345034#M79337</guid>
      <dc:creator>akhileshJoshi</dc:creator>
      <dc:date>2017-03-28T15:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple csv files in one SAS data set instead of multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/345049#M79342</link>
      <description>&lt;P&gt;You may want to go back to what ever file description you have for what your data should contain. You have a large number of your variables with and Informat of $1. That often means that the field was actually missing any values. When I see variables whose names end in Total I kind of expect them to be numeric as we seldom sum or "total" character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I see this:&lt;/P&gt;
&lt;PRE&gt;informat AC $1. ;
informat AD $1. ;
informat AL $11. ;
informat EP $1. ;
informat ET $11. ;

informat AC_EstTotal $1. ;
informat AD_EstTotal $1. ;
informat AL_EstTotal $11. ;
informat EP_EstTotal $1. ;
informat ET_EstTotal $11. ;&lt;/PRE&gt;
&lt;P&gt;I would expect that AC AD AL EP and ET are numeric and then you have totals. Would it be a far stretch to say that your orginal data file has many currency values such a $12,456.89 ? If you expect to do arithmetic later (ie SUM)&amp;nbsp;with them then you will want to address that issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main purpose of this part of the exercise is to get a file definition that will work for all of your expected data so you want to make sure that the informats are correct for your values. When you do get another file values, AC for example, then this code would truncate the value to the first character. Which if my guess is correct would be "$" or your currency symbol. So as a minimum you likely want all of those AC, AD etc variables to have a wider informat to read the &lt;STRONG&gt;longest expected&lt;/STRONG&gt; value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conversion to the code listed in &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s link is very simple.&lt;/P&gt;
&lt;P&gt;The link includes:&lt;/P&gt;
&lt;PRE&gt; 
*Use wildcard in input;
infile "Path\*.txt" eov=eov filename=filename truncover;
 
&lt;/PRE&gt;
&lt;P&gt;so using your example code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;infile 'D:\Raw_Data\RMS_Transposed_Canvass_History\*.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2
    eov=eov filename=filename truncover;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then just before the INPUT statement in the code you show add the&lt;/P&gt;
&lt;PRE&gt;*Input first record and hold line;
input@;
 
*Check if this is the first record or the first record in a new file;
*If it is, replace the filename with the new file name and move to next line;
if _n_ eq 1 or eov then do;
txt_file_name = scan(filename, -1, "\");
eov=0;
end;
 
*Otherwise  go to the import step and read the files;
else input  /*&amp;lt;= this is where the generated INPUT you show in your code goes*/
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure that all of the INFORMAT statements appear before the line with INPUT @;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post example code using the forum menu icon {i}. The forum otherwise tends to reformat code somewhat making it hard to read and inserting line breaks and such. This reformatting will sometimes result in code that does not run, always makes the code hard to read and just plain takes up too much screen space.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 16:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-csv-files-in-one-SAS-data-set-instead-of-multiple-data/m-p/345049#M79342</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-28T16:02:03Z</dc:date>
    </item>
  </channel>
</rss>

