SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 1033|回复: 0
打印 上一主题 下一主题

Add 10 buttons to enhance SAS 9.3 environment

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2011-9-12 06:54:08 | 只看该作者

Add 10 buttons to enhance SAS 9.3 environment

From Dapangmao's blog on sas-analysis

<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-P2Cs3YvgBuU/Tm02-05We5I/AAAAAAAAAvw/pPlFPowbRRk/s1600/Slide1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-P2Cs3YvgBuU/Tm02-05We5I/AAAAAAAAAvw/pPlFPowbRRk/s400/Slide1.JPG" width="400" /></a></div>One striking change in SAS 9.3 is that everything is HTMLized. Adding user-defined buttons to the toolbar of SAS’s windowing environment would make coding more efficient. <br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-fShcWIbpnic/Tm03CCBor3I/AAAAAAAAAv4/D1B9H9FEWDg/s1600/Slide2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/-fShcWIbpnic/Tm03CCBor3I/AAAAAAAAAv4/D1B9H9FEWDg/s400/Slide2.JPG" width="400" /></a></div>1. Clear log and result<br />
The most used SAS command is now prompted by a button.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
output;clear;log;clear;wpgm;
</code></pre>2. Clear files left by results viewer<br />
Lots of trash (mostly HTML files and PNG-formatted images by SAS 9.3's results viewer) would permanently remain in the current folder after each SAS session (the current folde is indicated on the Window Bar at the bottom). To avoid the possibility that someday the hard disk is jammed, clearing them out at times may be a good habit.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "options noxsync noxwait;x 'del *.htm';x 'del *.png';"
</code></pre>3. Clear work directory<br />
Everything in the WORK directory can be cleared out during a SAS session by such an approach.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "proc catalog c=work.sasmacr kill force;proc datasets kill nolist;quit;"
</code></pre>4. Turn off ODS graphics<br />
This code line closes ODS graphics for the statistics procedures if needed, and then saves resource expense.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "ods graphics off;"
</code></pre>5. Separate html<br />
SAS 9.3 stores all results in a very long html file that is what we see in the results viewer new html files. <a href="http://www.kenkleinman.net/home/index.php/sas-and-r-code/sas-tricks/77-clear-the-results-viewer-in-sas-93.html">Ken Kleinman</a> mentioned that running this code would generate a new html file. <br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "ods html close; ods html;"
</code></pre>6. Listing on<br />
One click to go back to the listing output if with output-intensive job.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "ods _all_ close; ods listing;"
</code></pre>7. Increase DPI<br />
The original image resolution in SAS 9.3 is set at low level for processing efficiency. Actually DPI (dots per inch) in SAS can be raised as high as 600. Graphs with 300 dpi would be decent for regular paperwork.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit"ods html image_dpi=300;"
</code></pre><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-f4sv3MfSyrk/Tm034euNvQI/AAAAAAAAAwA/Rw6MgiOFdTU/s1600/Slide3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://2.bp.blogspot.com/-f4sv3MfSyrk/Tm034euNvQI/AAAAAAAAAwA/Rw6MgiOFdTU/s400/Slide3.JPG" width="400" /></a></div><br />
8. Change style<br />
The default style in SAS 9.3 is htmlblue, which is an elegant and smooth html template. However, it has weaknesses: while it draws scatter plots, the overlapping dots tend to be indistinguishable. My favorite for scatting plots is 'harvest'. Aligning them together would see the difference. SAS 9.3 has many other styles.  I like 'navy' or 'money' for pictures that need high contrast. The styles 'journal/2/3' may be considered for publishing purpose.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit"ods html style=harvest;"
</code></pre>9. Recover formchar<br />
If you see tables on listing separated by weird charaters, it is time to click this button.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
gsubmit "options formchar='|----|+|---+=|-/\&lt;&gt;*';"</code></pre>10. Community help<br />
Searching the key words in <a href="http://listserv.uga.edu/archives/sas-l.html">SAS-L</a> is probably the most efficient way to find answers for any SAS question.  Another option is <a href="http://www.lexjansen.com/">Lex Jansen</a> that searches from total 15925 SAS conference proceeding papers.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
wbrowse 'http://listserv.uga.edu/archives/sas-l.html'
</code></pre><br />
Those user-defined buttons can be exported and imported by PROC CATALOG.<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
********EXPORT****************************;
proc catalog;
   copy in=sasuser.profile out=work.backup;
   select sasedit_main / et=toolbox;
quit;
********IMPORT****************************;
proc catalog;
   copy in=work.backup out=sasuser.profile;
   select sasedit_main / et=toolbox;
quit;
</code></pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3256159328630041416-7942326904093905554?l=www.sasanalysis.com' alt='' /></div><img src="http://feeds.feedburner.com/~r/SasAnalysis/~4/mB2CIYGBaMM" height="1" width="1"/>
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-5-7 23:20 , Processed in 0.066951 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表