<?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: SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227561#M5489</link>
    <description>I think this gets asked every day....&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Management/Macro-for-importing-multiple-txt-files-with-nonsequential-names/td-p/226964/page/2" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Management/Macro-for-importing-multiple-txt-files-with-nonsequential-names/td-p/226964/page/2&lt;/A&gt;</description>
    <pubDate>Mon, 28 Sep 2015 19:10:58 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-09-28T19:10:58Z</dc:date>
    <item>
      <title>SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227560#M5488</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My name is Chandra. I am not very good at SAS macro especially the looping part and resolving &amp;amp;&amp;amp;&amp;amp;. etc. Here is my problem statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Problem statement:&lt;/P&gt;
&lt;P&gt;I have large number of raw data files (.dat files) stored in a folder in a SAS server. I need a macro that can read each of these rawdata file and create SAS data set for each raw data file and store them in a separate target folder in the SAS server. All these raw data files have same file layout structure. I need to automate this operation so that every week, the macro reads raw data files from the source folder and creates the corresponding SAS dataset and stores them in the target folder in the SAS server. For example, if there are 200 raw data files in a source folder, I want to read them and create 200 SAS datasets one for each rawdata file and save them in a separate target folder. I am not very good at constructing looping statement and also resolving &amp;amp;&amp;amp; or &amp;amp;&amp;amp;&amp;amp; etc.&amp;nbsp; How do I do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would highly appreciate your kind assistance in this regard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Respectfully&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chandra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 19:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227560#M5488</guid>
      <dc:creator>u_chandra</dc:creator>
      <dc:date>2015-09-28T19:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227561#M5489</link>
      <description>I think this gets asked every day....&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Management/Macro-for-importing-multiple-txt-files-with-nonsequential-names/td-p/226964/page/2" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Management/Macro-for-importing-multiple-txt-files-with-nonsequential-names/td-p/226964/page/2&lt;/A&gt;</description>
      <pubDate>Mon, 28 Sep 2015 19:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227561#M5489</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-28T19:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227651#M5500</link>
      <description>&lt;P&gt;Chandra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get a list of files you can use this macro &lt;A href="http://www.sascommunity.org/wiki/Filelist_macro" target="_blank"&gt;http://www.sascommunity.org/wiki/Filelist_macro&lt;/A&gt; once you have the list of files I suggest you use a pattern very well described by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger﻿&lt;/a&gt; in his blog entry&amp;nbsp;&lt;A href="http://blogs.sas.com/content/sasdummy/2012/03/20/sas-program-by-processing/" target="_self"&gt;Implement BY processing for your entire SAS program.&lt;/A&gt; Well in your case it is not about BY Group processing but more like doing something over a list of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you need a new library for each SAS data set, have a look at the &lt;A href="http://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/" target="_self"&gt;SAS trick: get the LIBNAME statement to create folders for you&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/227651#M5500</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2015-09-29T13:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro to read multiple rawdata files and create multiple SAS dataset for each raw data file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/228307#M5551</link>
      <description>Creating 200+ files at different locations sounds like an non best practice. How do you maintain this, over time?&lt;BR /&gt;What is the the requirement?</description>
      <pubDate>Sat, 03 Oct 2015 02:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-macro-to-read-multiple-rawdata-files-and-create-multiple-SAS/m-p/228307#M5551</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-10-03T02:43:46Z</dc:date>
    </item>
  </channel>
</rss>

