0
我试图从SAS内部生成一个脚本。不幸的是,我需要写行SAS:引用问题
strMSHTA = "mshta.exe ""about:<input type=file id=FILE>" _
& "<script>FILE.click();new ActiveXObject('Scripting.FileSystemObject')" _
& ".GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>"""
写剧本到文件中,我使用以下方法:
/* write the script to file */
filename outfile ".\temp.vbs";
data _null_;
file outfile;
put 'WScript.Echo "Hello, World!"';
run;
/* run the script */
data _null_;
call system(".\temp.vbs");
run;
/* housekeeping */
%let rc=%sysfunc(fdelete(outfile));
%symdel rc;
filename outfile clear;
不幸的是,put
语句不善待&
,'
,和"
。我尝试了所有macro quoting functions,但无法获得任何工作。如有必要,我可以使用重载的连接运算符+
而不是&
。由于ActiveXObject('Scripting.FileSystemObject')
上的单引号,这样做只会在中间线上留下一个错误。有任何想法吗?
谢谢!我不知道我可以使用双单引号来防止外单引号关闭。我也不知道可以使用'/'来插入回车符。你碰巧知道我可以在SAS文档中找到这些解释吗? –
查看PUT语句的手册页。查找行指针控件的部分。在SAS语言中查找单词的概念页面。 http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p1qge1g4ytqq41n1e8x8s7ugmyst.htm – Tom