问题描述
我想知道是否有人知道如何检索元数据表的sas文件夹路径?
I'm wondering if anyone knows how to retrieve the sas folder path for metadata tables?
我想列出位于元数据上的每个表的文件夹路径
I would like to list the folder path for each tables located on metadata.
示例:
表FactPortfolio在管理控制台中处于以下结构:
Commerc ->瑞典->投资组合->资源->表
Table FactPortfolio is under the following fodler structure in management console:Commerc-->Sweden-->Portfolios-->Resources-->Tables
在sas的元数据浏览器中,如果单击表和树,则可以找到文件夹路径和父树,直到我到达最高层次。但是,我想使用SAS中的元数据数据步骤功能来检索它。
In metadata browser in sas, I can find the folder path if I click on tables and trees and parent trees until i reach the top hierarchy. However, I would like to retrieve it with metadata data step functions in SAS.
BR
Jonas
BRJonas
推荐答案
这可以在您知道表URI之后派生,例如:
This can be derived once you know the table URI, eg as follows:
%let metauri=OMSOBJ:PhysicalTable\A5HOSDWY.BE0006N9;
/* get metadata paths */
data ;
length tree_path $500 tree_uri parent_uri parent_name $200;
call missing(tree_path,tree_uri,parent_uri,parent_name);
drop tree_uri parent_uri parent_name rc ;
uri="&metauri";
rc=metadata_getnasn(uri,"Trees",1,tree_uri);
rc=metadata_getattr(tree_uri,"Name",tree_path);
do while (metadata_getnasn(tree_uri,"ParentTree",1,parent_uri)>0);
rc=metadata_getattr(parent_uri,"Name",parent_name);
tree_path=strip(parent_name)||'/'||strip(tree_path);
tree_uri=parent_uri;
end;
tree_path='/'||strip(tree_path);
run;
获取表URI的示例代码可以找到和。
Example code for getting table URI's can be found here and here.
这篇关于元数据表的SAS文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!