<?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: Data reading problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320688#M70661</link>
    <description>&lt;P&gt;It depends on what you're doing, but in general BY group processing is very powerful and you should look into it, if you have repetitive tasks.&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/69852/HTML/default/viewer.htm#n138da4gme3zb7n1nifpfhqv7clq.htm&amp;nbsp;&amp;nbsp;" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n138da4gme3zb7n1nifpfhqv7clq.htm&amp;nbsp;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intro to macro if you want to go down that route&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The last Appendix has a set of examples...Check out Example 1&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#titlepage.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#titlepage.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 07:51:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-12-22T07:51:01Z</dc:date>
    <item>
      <title>Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320667#M70652</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I face a problem, and I couldn't find better way to solve it.&lt;/P&gt;&lt;P&gt;Hope I can learn someting useful from you guys.&lt;/P&gt;&lt;P&gt;My problem is that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my libname folder, I have thounds of data.&lt;/P&gt;&lt;P&gt;Name of thses datas is basically composed by number, like&lt;/P&gt;&lt;P&gt;&amp;nbsp;"10002.MON", "10003.MON", ...,"90036.MON"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can imagine, if these names are continuous, then I will have 80035 (90036-10002+1) datas.&lt;/P&gt;&lt;P&gt;However, because these names are not continuous, I have only 2042 datas.&lt;/P&gt;&lt;P&gt;That is, "10002.MON", "10003.MON",(no 10004)"10005.MON"...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given that there are some steps need to be done within these datas, I need to read them all.&lt;/P&gt;&lt;P&gt;But when I use "do loop" to read them all, it is just too inefficient!&lt;/P&gt;&lt;P&gt;So I want to ask if there is more efficient way to catch all the data names in a specefic libname file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last, here is my code:&lt;/P&gt;&lt;P&gt;libname DB "F:\RunningDB\Chung-Li Wu\ABPM_subgroup analysis";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro Read_CleanData;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; %DO i=10002 %TO 90036;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; data raw&amp;amp;i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; infile "F:\BackUp\CL-Wu\Morning BP surge\raw data\ABPMAGE\MON\&amp;amp;i..MON"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; firstobs=9 delimiter="," truncover;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input SBP_night mean_BP_night DBP_night HR Hour Min;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; data raw&amp;amp;i(drop=mean_BP_night DBP_night HR Min);set raw&amp;amp;i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; data DB.raw&amp;amp;i;set raw&amp;amp;i;run;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proc printto log=myalfa new;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; %end;&lt;BR /&gt;%MEND;&lt;BR /&gt;%Read_CleanData;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 03:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320667#M70652</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2016-12-22T03:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320670#M70653</link>
      <description>&lt;P&gt;Look into the possibility of using wildcard characters in the file name to read multiple files, as in&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; infile "F:\BackUp\CL-Wu\Morning BP surge\raw data\ABPMAGE\*.MON" filename=currentFile ... ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;source = currentFile;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 04:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320670#M70653</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-22T04:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320671#M70654</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read all at one:&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;</description>
      <pubDate>Thu, 22 Dec 2016 04:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320671#M70654</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-22T04:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320681#M70658</link>
      <description>&lt;P&gt;PG,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this!&lt;/P&gt;&lt;P&gt;Though I'm still trying how to apply this after I read all datas, it is really helpful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 06:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320681#M70658</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2016-12-22T06:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320682#M70659</link>
      <description>&lt;P&gt;Reeza,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read your article.&lt;/P&gt;&lt;P&gt;The coding skill you mention is oustanding, and thank you for sharing it with us!&lt;/P&gt;&lt;P&gt;But somehow I'm wondering that after I input all these datas, can I still manipulate data without "do loop"?&lt;/P&gt;&lt;P&gt;I curious about this, because I still have tons of procedure need to do with my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 06:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320682#M70659</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2016-12-22T06:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data reading problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320688#M70661</link>
      <description>&lt;P&gt;It depends on what you're doing, but in general BY group processing is very powerful and you should look into it, if you have repetitive tasks.&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/69852/HTML/default/viewer.htm#n138da4gme3zb7n1nifpfhqv7clq.htm&amp;nbsp;&amp;nbsp;" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n138da4gme3zb7n1nifpfhqv7clq.htm&amp;nbsp;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intro to macro if you want to go down that route&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The last Appendix has a set of examples...Check out Example 1&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#titlepage.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#titlepage.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 07:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-reading-problem/m-p/320688#M70661</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-22T07:51:01Z</dc:date>
    </item>
  </channel>
</rss>

