小编Pan*_*ane的帖子

停止SAS执行

快问

是否有一个单行(或相当简短)的方法来取消进一步的SAS语句的执行与窗口环境.

这些是我所知道的方法,但它们令人厌倦,特别是在大量的评论中.我尝试了ABORTSTOP语句,但他们关闭了窗口环境但我想要的只是在某一点停止执行并继续我的快乐方式.

谢谢

sas

10
推荐指数
1
解决办法
1万
查看次数

从VBA运行SAS,具有完全访问权限

我希望有人能帮帮忙.我正在尝试构建一个子程序来从VBA启动SAS.我一直在使用SAS Workspace Manager.因为我在离我的舒适区很远的地方漫步,所以我大部分都遵循了这两个 来源.这是我到目前为止在VBA中提出的:

    Public Sub SubmitSasProg(usrid As String, passid As String, path As String, sasprog As String, varinput As String, Optional logreturn)
    Dim obWsMgr As New SASWorkspaceManager.WorkspaceManager

Dim obSAS As SAS.Workspace
Dim xmlInfo As String

Set obSAS = obWsMgr.Workspaces.CreateWorkspaceByServer("Local", VisibilityProcess, Nothing, usrid, passid, xmlInfo)

Dim obStoredProcessService As SAS.StoredProcessService
Set obStoredProcessService = obSAS.LanguageService.StoredProcessService

obStoredProcessService.Repository = "file:" & path
obStoredProcessService.Execute sasprog, varinput

If IsMissing(logreturn) Then logreturn = 100000
MsgBox obSAS.LanguageService.FlushLog(logreturn)

End Sub
Run Code Online (Sandbox Code Playgroud)

我有一个小SAS程序,我们称之为"Test.sas":

 %let loopTimes=3;
*ProcessBody;
data a;
do …
Run Code Online (Sandbox Code Playgroud)

workspace session vba login sas

6
推荐指数
1
解决办法
4240
查看次数

连接引用的宏变量

我只是想连接两个引用的宏变量,但似乎没有一个简单的方法.

说我们有:

%LET VAR1="This is not the greatest song in the world";
%LET VAR2="this is just a tribute.";

%LET TRIBUTE=%SYSFUNC(CATX(%STR( ),&VAR1,&VAR2));
%PUT &TRIBUTE;
Run Code Online (Sandbox Code Playgroud)

我其实想要:

  "This is not the greatest song in the world this is just a tribute."
Run Code Online (Sandbox Code Playgroud)

但上面的代码实际上产生了:

"This is not the greatest song in the world"  "this is just a tribute."
Run Code Online (Sandbox Code Playgroud)

所以,我尝试把%QUOTE(),%BQUOTE等.周围,&VAR1%VAR2希望揭开报价,但我得到相同的结果.

唯一对我有用的是:

 %LET TRIBUTE="%SUBSTR(&VAR1.,2,%LENGTH(&VAR1.)-2) %SUBSTR(&VAR2.,2,%LENGTH(&VAR2.)-2)"; 
Run Code Online (Sandbox Code Playgroud)

但这很难看,而且可以很快地变得冗长.有没有更好的方法来做到这一点?

concatenation sas sas-macro

5
推荐指数
1
解决办法
1万
查看次数

与Rcpp相交功能

我很难用Rcpp模块实现一个函数cppFunction.我需要使用类似R的intersect两个NumericVector类型,并返回另一个NumericVector与结果,就像在R.

这个文档有一些帮助,但不幸的是我在C++ atm中几乎是一个菜鸟.

我怎么能用intersectR函数实现cppFunction

谢谢

c++ r rcpp

1
推荐指数
1
解决办法
642
查看次数

标签 统计

sas ×3

c++ ×1

concatenation ×1

login ×1

r ×1

rcpp ×1

sas-macro ×1

session ×1

vba ×1

workspace ×1