免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2111 | 回复: 0
打印 上一主题 下一主题

在UltraEdit中运行SAS代码-配置图解 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-22 21:19 |只看该作者 |倒序浏览

在UltraEdit(UE)中编辑SAS代码是很方便的,尤其是同时查看很多不同的脚本时(关于在UE中实现SAS代码高亮显示,见文末)。以前有一篇《
在UltraEdit中配置Java编译器
》,现在说说如何在UltraEdit(UE)中配置SAS,不完全是玩具功能,偶尔有用。我的测试环境是:
UltraEdit Professional Version 14.00a+1
SAS 9.1.3 Service Pack 4
Microsoft Windows  XP Professional Version 2002, Service Pack 2
Intel(R) Core(TM)2 Duo CPU, 1.95GB of RAM
1.UE->Advanced->Tool Configuration->Insert
打开UE,依上面的顺序点击工具栏,你将看到类似下面的Command、Options和Output界面,先在Command栏目,Menu Item Name一栏,写上SAS或者其他能提醒自己的词,在Working Directory一栏填上%p。困难在于Command Line一栏,下面详述之。



2.Start->All Programs->SAS->SAS 9.1(English)->Properties
Command Line一栏涉及如何激活你的SAS系统。在你的机器里,依上点“开始”->“所有程序”等,你将看到如下对窗口:


我们需要的Target(目标)一栏的字符串,我机器的SAS系统装在D盘,所以这一行是这样的:
D:\SAS9\sas.exe -CONFIG D:\SAS9\nls\1d\SASV9.CFG
把以上Target栏中的东西复制到上面提到的Command Line中,后面再加上这么些SAS系统选项(后面再解释):
-noicon -nosplash -batch -sysin %n
所以,最后Command Line一栏看上去是这样的(注意:如果你的SAS系统装在其他路径,Target项目会有所不同):
D:\SAS9\sas.exe -CONFIG D:\SAS9\nls\1d\SASV9.CFG  -noicon -nosplash -batch -sysin %n
3.Options
在Options栏目里,勾上Windows Program和Save all files first。


4.Output
在Output栏目里,勾上Output to List Box、Capture Output以及Captured Output。


按OK结束。在UE->Advanced的最下面,你将看到新建成功的SAS项目。大功告成哈尔莫斯。
/*以上参考
Batch Submission Using Ultraedit
,里面UE和SAS的版本都很旧。*/

随便在SAS Help找一段不是特简单的代码,比如下面的,把它们复制到UE,并保存为比如ultraedit.sas,路径在,比如D:\Ultreedit-SAS\,接下来所有的结果都会保存在这个路径下,而且在UE中点File->Open,也会直接到达这个所谓当前文件夹:
data Setosa;
        input SepalLength SepalWidth PetalLength PetalWidth @@;
        label sepallength='Sepal Length in mm.'
              sepalwidth='Sepal Width in mm.'
              petallength='Petal Length in mm.'
              petalwidth='Petal Width in mm.';
        datalines;
      50 33 14 02  46 34 14 03  46 36 .  02
      51 33 17 05  55 35 13 02  48 31 16 02
      52 34 14 02  49 36 14 01  44 32 13 02
      50 35 16 06  44 30 13 02  47 32 16 02
      48 30 14 03  51 38 16 02  48 34 19 02
      50 30 16 02  50 32 12 02  43 30 11 .
      58 40 12 02  51 38 19 04  49 30 14 02
      51 35 14 02  50 34 16 04  46 32 14 02
      57 44 15 04  50 36 14 02  54 34 15 04
      52 41 15 .   55 42 14 02  49 31 15 02
      54 39 17 04  50 34 15 02  44 29 14 02
      47 32 13 02  46 31 15 02  51 34 15 02
      50 35 13 03  49 31 15 01  54 37 15 02
      54 39 13 04  51 35 14 03  48 34 16 02
      48 30 14 01  45 23 13 03  57 38 17 03
      51 38 15 03  54 34 17 02  51 37 15 04
      52 35 15 02  53 37 15 02
      ;
   ods html;
   ods graphics on;
   title 'Fisher (1936) Iris Setosa Data';
   proc corr data=Setosa sscp cov plots;
      var  sepallength sepalwidth;
      with petallength petalwidth;
   run;
   ods graphics off;
   ods html close;
就在这段代码上,点Advanced->SAS 运行,稍等你就能在D:\Ultreedit-SAS看到所有的结果:


其中,
ultraedit.sas是我们测试的代码,在UE里编辑和运行;
ultraedit.log 是这次任务的日志文件,可以用UE打开;
ultraedit.lst 是list output,可以用UE打开,依次见下:


sashtml.htm 是html output,可以用默认的浏览器打开;
RecMatrixPlot0.gif是上面程序产生的散点图图片。




--------------------------附录---------------------------------
5.如果以上都没问题,那么我们就可以参详一下在以上设置中碰到的SAS系统选项:
sysin-specifies to start the SAS System and submit the file in batch mode
noicon-specifies to restore the main SAS window immediately
nosplash-specifies to not display the logo screen when the SAS System initiates
6.关于UE里SAS代码高亮显示,见
http://idmcomp.com/index.php?name=Content&pa=showpage&pid=40

Technorati Tags:
SAS
,
Ultraedit
,
Configutation
,
highlighting


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/69783/showart_699715.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP