Adjust Metadata URI to Exclude WorkTable Metadata Type

99封情书 提交于 2019-12-11 06:25:43

问题


I've built the code below for getting a list of SAS registered tables from metadata. It works fine but takes a long time to run due to the large volume of WorkTables (a subtype of PhysicalTable):

data work.tables (keep=uri name);
  length uri name $256;
  n=1;
  do while(metadata_getnobj("omsobj:PhysicalTable?@Id contains '.'",n,uri)>=0);
    n+1;
    if substr(uri,8,9)='WorkTable' then continue;
    if metadata_getattr(uri, "SASTableName", name)=0 then output;
  end;
run;

Is there any way to adjust the uri so that the WorkTable type can be excluded in the metadata query itself?

Eg as follows (doesn't work):

omsobj:PhysicalTable?@Id contains '.' and @MetadataType ne 'WorkTable'

回答1:


So the following URI did the trick, although it was only 20% faster:

omsobj:PhysicalTable?@Id contains '.' and @PublicType = 'Table'

This can of course be shortened to:

omsobj:PhysicalTable?@PublicType = 'Table'

Which shaved off an extra 0.2 seconds.



来源:https://stackoverflow.com/questions/40462703/adjust-metadata-uri-to-exclude-worktable-metadata-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!