<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matthew St. Peter</title>
	<atom:link href="http://matthewstpeter.com/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewstpeter.com/blog</link>
	<description>Professional Science in Industrial Mathematics</description>
	<lastBuildDate>Thu, 09 Sep 2010 04:14:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Directory Scan Macro</title>
		<link>http://matthewstpeter.com/blog/2010/09/08/directory-scan-macro/</link>
		<comments>http://matthewstpeter.com/blog/2010/09/08/directory-scan-macro/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 03:36:42 +0000</pubDate>
		<dc:creator>Matthew St. Peter</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Macros]]></category>
		<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://matthewstpeter.com/blog/2010/09/08/</guid>
		<description><![CDATA[<p>Ever need to read in an entire directory of files into SAS? This macro was developed with Excel files in mind, but you can specify the extension of your choosing.</p>
<p></p>
<p>First &#8211; the macro:</p>

/*-------------------------------------------------------------------*\
&#124; directory_scan macro
&#124; MSP 2010-08
&#124;
&#124; this macro will open the directory specified and extract a full
&#124; path and data set name to use for <span style="color:#777"> . . . &#8594; Read More: <a href="http://matthewstpeter.com/blog/2010/09/08/directory-scan-macro/">Directory Scan Macro</a></span>]]></description>
			<content:encoded><![CDATA[<p>Ever need to read in an entire directory of files into SAS? This macro was developed with Excel files in mind, but you can specify the extension of your choosing.</p>
<p><span id="more-90"></span></p>
<p>First &#8211; the macro:</p>
<pre>
<span style="color: green">/*-------------------------------------------------------------------*\
| directory_scan macro
| MSP 2010-08
|
| this macro will open the directory specified and extract a full
| path and data set name to use for future PROC IMPORTS
|
| the default behavior is to scan for excel files and create a dataset
| called excellist. however, this can be modified using the optional
| keyword parameters defined below.
\*-------------------------------------------------------------------*/
</span>
<span style="color: #036; font-weight: bold">%macro</span> directory_scan(
  <span style="color: green">/* MANDATORY POSITIONAL PARAMETERS */</span>
  path,             <span style="color: green"> /* the path that you wish to scan */</span>
  <span style="color: green">/* OPTIONAL KEYWORD PARAMETERS */</span>
  <span style="color: green">/* EVERYTHING WILL DEFAULT TO EXCEL UNLESS SPECIFIED */</span>
  dsn=excelList,     <span style="color: green">/* the dataset name to store the information */</span>
  ext=.xls           <span style="color: green">/* optional parameter, to be used</span>
                        <span style="color: green">if the extension isn't xls */</span>
  );
<span style="color: blue">data</span> &#038;dsn.(keep= dsName fullPath);
  rc = filename('mydir',&#038;path.);
  dirid=dopen('mydir');
  memcount=dnum(dirid);
  extension = prxparse("|&#038;ext.|");
  do i = 1 to memcount;
    <span style="color: green">/*-------------------------------------*\
    | for each file in the directory,
    | create a sas dataset name that
    | depends on the filename. The SAS
    | dataset is truncated to 27 characters
    | so that other datasets can be created
    | named after the ones created here.
    \*-------------------------------------*/</span>
    dsName = dread(dirid,i);
    fullPath = &#038;path. || dsName;
    extPos = prxmatch(extension,dsName);
    if extPos > 0 then do;
      dsName = translate(dsName,'_',' ','_','-','_','.','_','&#038;');
      dsName = substr(dsName,1,extPos-1);
      if length(dsName) > 27 then dsName = substr(dsName,1,27);
      output;
    end;
  end;
<span style="color: blue">run;</span>
<span style="color: #036; font-weight: bold">%mend</span>;
</pre>
<p>The end result is a dataset that contains a dataset name (based on the filename) and the absolute path to each file in a specified directory.</p>
<p>This makes for a nice combination with the CALL EXECUTE statement &#8211; you can create a bunch of different SAS datasets with <em>very little effort</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewstpeter.com/blog/2010/09/08/directory-scan-macro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Testing the LaTeX plug-in</title>
		<link>http://matthewstpeter.com/blog/2010/09/04/quick-testing-the-latex-plug-in/</link>
		<comments>http://matthewstpeter.com/blog/2010/09/04/quick-testing-the-latex-plug-in/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 03:22:50 +0000</pubDate>
		<dc:creator>Matthew St. Peter</dc:creator>
				<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://matthewstpeter.com/blog/2010/09/04/</guid>
		<description><![CDATA[<p>It can&#8217;t really be a math blog without , <span style="color:#777"> . . . &#8594; Read More: <a href="http://matthewstpeter.com/blog/2010/09/04/quick-testing-the-latex-plug-in/">Quick Testing the LaTeX plug-in</a></span>]]></description>
			<content:encoded><![CDATA[<p>It can&#8217;t really be a math blog without <img src='http://s.wordpress.com/latex.php?latex=%5CLaTeX&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\LaTeX' title='\LaTeX' class='latex' />, can it?<br />
<span id="more-53"></span></p>
<img src='http://s.wordpress.com/latex.php?latex=e%5E%7B%5Ci%20%5Cpi%7D%20%2B%201%20%3D%200&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e^{\i \pi} + 1 = 0' title='e^{\i \pi} + 1 = 0' class='latex' />
]]></content:encoded>
			<wfw:commentRss>http://matthewstpeter.com/blog/2010/09/04/quick-testing-the-latex-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Theme Design</title>
		<link>http://matthewstpeter.com/blog/2009/05/16/a-stable-theme-has-appeared/</link>
		<comments>http://matthewstpeter.com/blog/2009/05/16/a-stable-theme-has-appeared/#comments</comments>
		<pubDate>Sat, 16 May 2009 19:46:29 +0000</pubDate>
		<dc:creator>Matthew St. Peter</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://matthewstpeter.com/blog/2009/05/16/a-stable-theme-has-appeared/</guid>
		<description><![CDATA[Developing a cross-browser WordPress theme is difficult. Thanks, Internet Explorer. <span style="color:#777"> . . . &#8594; Read More: <a href="http://matthewstpeter.com/blog/2009/05/16/a-stable-theme-has-appeared/">WordPress Theme Design</a></span>]]></description>
			<content:encoded><![CDATA[<p>After trying to develop a fully-liquid WordPress theme, I came to the conclusion that it&#8217;s more worthwhile to pull a theme off the shelf and fill it with content rather than try to engineer my own.</p>
<p>Internet Explorer, you&#8217;ve defeated me. To all web coders who understand and can implement the workarounds necessary to create true cross-browser compatibility, I salute you.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewstpeter.com/blog/2009/05/16/a-stable-theme-has-appeared/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

