SAS 9.2 中的metadata_newobj 函数有bug?
我有一个 SAS 应用程序,正在使用新发布的 SAS 9.2 进行测试。 我调用metadat_newobj函数来在SAS元数据存储库中创建一个新的Library对象:
rc = metadata_newobj( "SASLibrary", URI, Name );
在9.1.3中,当函数成功执行(rc = 0)时,URI变量将使用新创建的Library对象的URI填充。
在 SAS 9.2 中,虽然返回值为 0(成功)并且确实创建了 Library 对象(我使用管理控制台手动检查),但 URI 变量保持空白,因此设置属性等的任何后续操作都会失败。
两个版本的文档都将 URI 列为该函数的输出参数。
有人对此有了解吗?
编辑:我使用的代码如下:
put libraryName=;
rc = metadata_newobj("SASLibrary", libraryUri, libraryName);
if rc ne 0 then do;
/* Error handler */
return;
end;
put libraryUri=;
和输出:
libraryName=HRLIB10
libraryUri=
我尝试使用 PROC METADATA
来解决这个问题,这似乎有效。 :\
编辑 #2: 我刚刚意识到我没有提到这是在 SCL 代码中。
I have a SAS application that I am testing with the newly released SAS 9.2. I have a call to the metadat_newobj function to create a new Library object in the SAS metadata repository:
rc = metadata_newobj( "SASLibrary", URI, Name );
In 9.1.3, when the function executed successfully (rc = 0), the URI variable was populated with the URI of the newly created Library object.
In SAS 9.2, although the return value is 0 (Successful) and the Library object does get created (I checked manually using the management console), the URI variable stays blank so any subsequent operations to set attributes etc fail.
The documentation for both versions lists URI as an output parameter of this function.
Does anyone have any knowledge of this?
EDIT: The code I was using is as follows:
put libraryName=;
rc = metadata_newobj("SASLibrary", libraryUri, libraryName);
if rc ne 0 then do;
/* Error handler */
return;
end;
put libraryUri=;
and the output:
libraryName=HRLIB10
libraryUri=
I'm trying to work around this using PROC METADATA
instead, which seems to be working. :\
EDIT #2: I just realized that I have not mentioned that this is within SCL code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我有用。 根据您提供的示例,我建议在 NAME 周围加上引号。 也可以在运行metadata_newobj 之前使用长度语句来设置uri。 否则,为了分享,请告诉我们您是否通过其他技术解决了该问题。
这是我运行的内容:
这是我的日志:
It worked for me. Based on the example you gave I'd suggest putting quotes around NAME. Also maybe use a length statement to setup uri prior to running metadata_newobj. Otherwise, in the interest of sharing, let us know if you get it resolved with some other technique.
Here's what I ran:
Here's my log:
我没有发现任何表明metadata_newobj 在新版本中发生更改的内容。 然而,它只是拒绝为我工作。 因此,我将函数转换为使用 PROC METADATA,现在它可以在 SAS 9.1.3 和 SAS 9.2 中运行,
谢谢大家。
I didn't find anything that suggests metadata_newobj had changed in the new version. However, it just refused to work for me. So I converted my functions to use
PROC METADATA
and now it works in SAS 9.1.3 and SAS 9.2Thanks all.