<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0" xml:base="http://www.stattler.com">
<channel>
 <title>stattler.com - SAS</title>
 <link>http://www.stattler.com/category/sas</link>
 <description>Content primarily about SAS software, SAS codes
</description>
 <language>en</language>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/stattler/sas" /><feedburner:info uri="stattler/sas" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>stattler/sas</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
 <title>Remotely running SAS in Interactive Mode using ESS</title>
 <link>http://feedproxy.google.com/~r/stattler/sas/~3/dtd1pLRmA5s/remotely-running-sas-interactive-mode-using-ess</link>
 <description>&lt;div class="field field-name-body field-type-text-with-summary field-label-hidden"&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;p&gt;&lt;p&gt;&lt;a href="http://www.sas.com" class="bb-url"&gt;SAS&lt;/a&gt; is probably the most acclaimed data analysis and Business Analytics software currently available in market. It is used primarily for data analysis in academic and research institutions, and for data mining in business and enterprises. &lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;SUMMARY&lt;/span&gt;&lt;br /&gt;
If you do not have SAS in your computer but have access to a remote server where it is installed, this article is for you. I have summarized the process of running SAS program interactively (not in batch mode) on a remote server with the aid of two popular software-- Emacs and ESS. You need to have these software installed on your PC (either Linux or Windows-based computers are fine but Linux would be more convenient).&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;BACKGROUND&lt;/span&gt;&lt;br /&gt;
Since 9.2 version of it, SAS Institute has changed their license policy and that made it impossible for me to have a copy of SAS from my university. My university installs SAS only for the professors. We have SAS 9.2 installed in our graduate computer lab and also in the  central computational server. My only option was to run SAS remotely by loggin in to the  Academic Research and Computing (ARC1) server at University of Windsor. &lt;/p&gt;
&lt;p&gt;ARC1 runs the Unix version of SAS 9.2 (as of January 25, 2010). I need to login via ssh and work with SAS in batch mode. Unlike SAS in Windows, the Solaris in ARC1 server do not provide any graphical environment for running SAS. Batch mode processing is the only option (to my knowledge). For command line interface (CLI), once you are logged in to the server, go to a folder (or create if needed) where you want to store your SAS program (.sas), SAS log (.log) and SAS output (.lst) files. You can then use &lt;code class="bb-code"&gt;vi&lt;/code&gt; or &lt;code class="bb-code"&gt;pico&lt;/code&gt; or any other editor for creating a SAS program file. To run SAS in batch mode, use &lt;code&gt;sas filename.sas&lt;/code&gt; at the terminal prompt.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;SOLUTIONS&lt;/span&gt;&lt;br /&gt;
Apart from running SAS 9.2 in batch mode, there are two other ways of working with it interactively. (1) by loading SAS from a Linux PC via ssh -X or (2) by connecting SAS server via Emacs + ESS. &lt;/p&gt;
&lt;p&gt;To load SAS graphical interface, you need to login to server using the following options with ssh:&lt;br /&gt;
&lt;code class="bb-code"&gt;ssh -X username_nospace @servername.com&lt;/code&gt; Note the capital X, not small x.&lt;br /&gt;
This will load SAS on your local linux box with a graphical interface. Remember that &lt;code class="bb-code"&gt;-X&lt;/code&gt; options in ssh. Without this &lt;code class="bb-code"&gt;-X&lt;/code&gt; option, you cannot load the graphical interface of SAS remotely. &lt;/p&gt;
&lt;p&gt;The second option is to run SAS remotely via &lt;a href="http://ess.r-project.org/Manual/ess.html" class="bb-url"&gt;ESS&lt;/a&gt;. ESS stands for &lt;span style="font-weight:bold"&gt;E&lt;/span&gt;macs &lt;span style="font-weight:bold"&gt;S&lt;/span&gt;peaks &lt;span style="font-weight:bold"&gt;S&lt;/span&gt;tatistics. For an introduction to ESS and Emacs, please read &lt;a href="http://www.stattler.com/node/26" class="bb-url"&gt;this post&lt;/a&gt;. I am listing the steps needed to successfully connecting to a remote server running SAS and loading SAS to ESS buffer and then running SAS interactively.&lt;/p&gt;
&lt;p&gt;&lt;ol class="bb-list" style="list-style-type:decimal;"&gt;
 &lt;li&gt;Load your Emacs. On a terminal, type &lt;code class="bb-code"&gt;emacs&lt;/code&gt; or &lt;code class="bb-code"&gt;emacs &amp;amp;&lt;/code&gt;. The latest version of GNU Emacs is 23.x.&lt;/li&gt; &lt;li&gt; Load the ssh library: Type &lt;span style="color:blue;"&gt;Alt+x load-library&lt;/span&gt; and then type &lt;code class="bb-code"&gt;ssh&lt;/code&gt;. I assume that you have already put the ssh.el file in your directory path. If not, then download it from &lt;a href="http://www.splode.com/~friedman/software/emacs-lisp/src/ssh.el" class="bb-url"&gt;here&lt;/a&gt;.
and put it in &lt;code class="bb-code"&gt;/usr/share/emacs/23.1/lisp/&lt;/code&gt; (assuming that this is your emacs path). Also make sure that the following is in your &lt;span style="color:red;"&gt;.emacs&lt;/span&gt; file located in your unix home folder, usually under &lt;code class="bb-code"&gt;/home/username/&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;(require 'tramp)&lt;br /&gt;
(setq tramp-default-method "ssh")&lt;br /&gt;
; Emacs Load Path&lt;br /&gt;
(setq load-path (cons "/usr/share/emacs/23.1/lisp"&lt;br /&gt;
load-path))
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;/li&gt;&lt;li&gt; Once the ssh library is loaded, type &lt;span style="color:blue;"&gt;Alt +x ssh&lt;/span&gt;. Then enter your userid @ servername. Provide your password when prompted.&lt;/li&gt;
&lt;li&gt; You are at the terminal of your remote server. Now its time to run SAS. type &lt;code class="bb-code"&gt;sas -stdio&lt;/code&gt;&lt;/li&gt;
&lt;li&gt; Type &lt;span style="color:blue;"&gt;Alt+x ess-remote&lt;/span&gt;&lt;/li&gt;
&lt;li&gt; At the prompt, type &lt;span style="color:blue;"&gt;sas&lt;/span&gt;&lt;/li&gt;
&lt;li&gt; Load your file. Type the path (either local file or remote file. For remote file, you have to provide path beginning with your&lt;code class="bb-code"&gt; user_no_space @domain.com:/path/to/file/file.sas&lt;/code&gt;&lt;/li&gt;
&lt;li&gt; Go to the buffer where SAS is running. Then &lt;span style="color:blue;"&gt;Alt+x ess-sas-interactive&lt;/span&gt;&lt;/li&gt;
&lt;li&gt; Now go back to the program buffer and start editing (or) processing your codes. To submit a single line, use &lt;span style="color:blue;"&gt;Ctrl+c Ctrl +n&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/sites/stattler.com/files//users/er/ess-sas-emacs.png" width="600" height="366" alt="ess-sas-emacs.png" /&gt;&lt;br /&gt;
Now expand your emacs window and split it using the command &lt;span style="color:blue;"&gt;Ctrl+x 3&lt;/span&gt;. To browse the buffers, use command &lt;span style="color:blue;"&gt;Ctrl+x left-arrow&lt;/span&gt; or &lt;span style="color:blue;"&gt;Ctrl+x right-arrow&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;SHORTCUTS&lt;/span&gt;&lt;br /&gt;
Here I am listing a few shortcuts for ESS[SAS]. The command is not case sensitive, meaning that capital letters in the commands can be small letters.&lt;/p&gt;
&lt;p&gt;&lt;span style="color:blue;"&gt;Ctrl+C Ctrl+N&lt;/span&gt; to submit one line to the SAS buffer&lt;br /&gt;
&lt;span style="color:blue;"&gt;Ctrl+C Ctrl+spacebar&lt;/span&gt; to start selecting a region. Use your arrow key to go up or down to highlight the area you want to select.&lt;br /&gt;
&lt;span style="color:blue;"&gt;Ctrl+C Ctrl +G&lt;/span&gt; to cancel selection&lt;br /&gt;
&lt;span style="color:blue;"&gt;Ctrl+C Ctrl+R&lt;/span&gt; to submit the selected region to the SAS buffer&lt;br /&gt;
&lt;span style="color:blue;"&gt;Ctrl+C Ctrl+B&lt;/span&gt; to submit the entire buffer to the SAS buffer.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;USEFUL LINKS&lt;/span&gt;&lt;br /&gt;
ESS process on remote computers:&lt;br /&gt;
http://www.xemacs.org/Documentation/packages/html/ess_3.html#SEC15&lt;/p&gt;
&lt;p&gt;About Interactive ESS process (I couldn't get them working for remote servers)&lt;br /&gt;
http://www.xemacs.org/Documentation/packages/html/ess_10.html#SEC60&lt;/p&gt;
&lt;p&gt;Some ESS shortcuts, may be useful for ESS[SAS] as well&lt;br /&gt;
http://www.stattler.com/article/emacs-latex-and-ess-shortcuts-beginners&lt;/p&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="field field-name-field-topic field-type-taxonomy-term-reference field-label-inline clearfix"&gt;&lt;div class="field-label"&gt;Category:&amp;nbsp;&lt;/div&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;a href="/category/sas"&gt;SAS&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="field field-name-field-tag field-type-taxonomy-term-reference field-label-inline clearfix"&gt;&lt;div class="field-label"&gt;Tag:&amp;nbsp;&lt;/div&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;a href="/taxonomy/term/273"&gt;emacs&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/stattler/sas/~4/dtd1pLRmA5s" height="1" width="1"/&gt;</description>
 <pubDate>Tue, 26 Jan 2010 00:21:08 +0000</pubDate>
 <dc:creator>enayet</dc:creator>
 <guid isPermaLink="false">40 at http://www.stattler.com</guid>
 <comments>http://www.stattler.com/blog/remotely-running-sas-interactive-mode-using-ess#comments</comments>
<feedburner:origLink>http://www.stattler.com/blog/remotely-running-sas-interactive-mode-using-ess</feedburner:origLink></item>
<item>
 <title>Introductory Reference on SAS</title>
 <link>http://feedproxy.google.com/~r/stattler/sas/~3/nrLLXYAnLVk/introductory-reference-sas</link>
 <description>&lt;div class="field field-name-body field-type-text-with-summary field-label-hidden"&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;p&gt;&lt;p&gt;When I was in 2nd year of my undergrad in Dhaka University, my elder brother got me a gift which he bought for me while coming back after finishing his course works in U.S.; The gift was a thin book and the title of the book was sort of funny - &amp;quot;&lt;a href="http://support.sas.com/publishing/bbu/companion_site/59216.html"&gt;The Little SAS Book: A Primer&lt;/a&gt;&amp;quot; written by two ladies &lt;span class="addmd"&gt;Lora D. Delwiche and  Susan J. Slaughter. My brother is a non-statistical person and the text in my university was something else - &amp;quot;&lt;a href="http://books.google.com/books?id=hulIAAAACAAJ"&gt;Applied Statistics and the SAS Programming Language&lt;/a&gt;&amp;quot; by &lt;/span&gt;&lt;span class="addmd"&gt;Ronald P. Cody and Jeffrey K. Smith&lt;/span&gt;, which is recognized as a good text all over the world.&lt;/p&gt;
&lt;p&gt;However, when I started reading the book, I was fascinated by the idea of the organization of the book: it had 10 chapters and each was filled up with small sections, each ending within 2 pages! The writting was so non-technical, I could not resist reading the entire book at a stretch! I guess the book might not be appropriate as a text for professional statisticians, but could be great start for a 2nd year statistics student who might like to explore SAS by him/her-self before any regular course. The book by Ronald P. Cody and Jeffrey K. Smith is a great book, but some students could find it too wordy, but &amp;quot;&lt;a href="http://books.google.com/books?id=14CSsIUQ24kC&amp;amp;printsec=frontcover&amp;amp;source=gbs_summary_r&amp;amp;cad=0"&gt;The Little SAS Book: A Primer&lt;/a&gt;&amp;quot; is very concise and easy reading for any audience, statistician or non-statistician.&lt;/p&gt;
&lt;p&gt;A sample chapter can be viewed in &lt;a href="http://support.sas.com/publishing/pubcat/chaps/59216.pdf"&gt;sas support site&lt;/a&gt; and all the codes are available in &lt;a href="http://ftp.sas.com/samples/A59216"&gt;sas ftp site&lt;/a&gt; (please check &lt;a href="http://support.sas.com/publishing/bbu/companion_site/index.html"&gt;sas companion sites&lt;/a&gt; for more fascinating books and reviews). Good thing, I left the book in ISRT library before I left Bangladesh. I hope others also get in touch of this particular book and feel the same joy I felt several years ago :)&lt;/p&gt;
&lt;p class="rteleft"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt; (The above comentary was written assuming audience knows the value of SAS in the statistics community, along with the bizarre coding system it has :p)&lt;/p&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="field field-name-field-topic field-type-taxonomy-term-reference field-label-inline clearfix"&gt;&lt;div class="field-label"&gt;Category:&amp;nbsp;&lt;/div&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;a href="/category/sas"&gt;SAS&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/stattler/sas/~4/nrLLXYAnLVk" height="1" width="1"/&gt;</description>
 <pubDate>Sat, 23 Jan 2010 13:54:19 +0000</pubDate>
 <dc:creator>wildscop</dc:creator>
 <guid isPermaLink="false">37 at http://www.stattler.com</guid>
 <comments>http://www.stattler.com/blog/introductory-reference-sas#comments</comments>
<feedburner:origLink>http://www.stattler.com/blog/introductory-reference-sas</feedburner:origLink></item>
</channel>
</rss>
