sas应用程序外部执行配置

类别:编程语言 点击:0 评论:0 推荐:

1。主要由一配置文件和一外部SAS文件组成

 配置文件用于配置一些参数信息,便于程序中获取
 
 SAS文件用来执行一些初始化动作,从配置文件中指定,也可以命名为autoexec.sas
 
 配置文件中可以使用一下指令
 
 -SET CITY D:\report
 -autoexec !CITY\autoexec.sas(指定自动执行的文件名)
 -INITCMD 'AF CATALOG=CITY.CITY.MAIN.FRAME'(指定初始化后执行的命令)
 -awstitle "PowerViewer Session Clear Program"(指定窗口标题)
 -rsasuser
 -nodmsexp(其他的一些选项)
 
 在SAS文件中获取配置文件的SET变量用:!varname;
 如
 libname crlibp "!crlibp";
 
2. 在SCL中获取配置文件的SET变量用SYMGET,如
  if symget("sysscp")="WIN" then                                                                                                         
  do;                                                                                                                                    
        put "Win";                                                                                                                       
        t=substr(pathname("scann"),1);                                                                                                   
        put t=;                                                                                                                          
        call symput("scann",substr(pathname("scann"),4));                                                                                
        t=substr(pathname("timeoutn"),1);                                                                                                
        put t=;                                                                                                                          
                                                                                                                                         
        call symput("time_outn",substr(pathname("timeoutn"),4));                                                                         
  end;                                                                                                                                   
  else                                                                                                                                   
  do;                                                                                                                                    
        call symput("scann",substr(pathname("scann"),2));                                                                                
        call symput("time_outn",substr(pathname("time_outn"),2));                                                                        
  end;                                                                                                                                   
 获取系统参数,如awstitle,用optgetc或者optgetn,如
 optgetc("awstitle")
3.也可以在SAS文件中使用%let语句置宏,在SCL中用symget获取即可
如:
sas文件中:
%let var1=hello
scl文件中
symget("var1")
 
4。指定SAS使用指定的配置文件,可建一BAT文件,获者建立一个SAS的快捷方式,在其中指定参数
如:
"C:\Program Files\SAS Institute\SAS\V8\sas.exe" -config "D:\report\config\sasv8.cfg"

本文地址:http://com.8s8s.com/it/it28798.htm