How to get details of metadata objects in SAS

后端 未结 2 558
面向向阳花
面向向阳花 2021-01-24 18:33

I have a list of metadata objects from my repository. I\'ve fetched all SASLibrary, PhysicalTable, Jobs objects. Now I need to fetch all their details. Can someone please sugge

2条回答
  •  故里飘歌
    2021-01-24 19:01

    for example call this macro for metaobjects intereseting to you. The fullList table will contains all your interesting objects with metaId and object type:

        options Metaport=portnumber;                                                                                                                                                                                                                            
        options MetaUser="userid";                                                                                                                                                                                                                                          
        options Metapass="password";                                                                                                                                                                                                                                           
        options MetaServer="serverName"; 
        options metaprotocol=bridge;
    
        data fullList;
        length objName $60 objId $17 objType $50;;
        delete;
        run;
    
        %macro getMeta(objType);
                data temp(keep=objType objName objId);
                    length uri $256 objName $60 objId $17 objType $50;
                    uri="";n=1;TableName="";
                    objType="&objType";
                        do while(metadata_getnobj("omsobj:&objType?@Id ? '.'",n,uri) >= 0);
                                rc=metadata_getattr(uri,"Name",objName);
                                rc=metadata_getattr(uri,"Id",objId);
                                n=n+1; 
                                output;
                        end;
                run;
                proc append base=fullList data=temp;
                run;
        %mend;
        %getMeta(Person);
        %getMeta(PhysicalTable);
        %getMeta(Job);
        %getMeta(JFob);
        .
        .
        . if you want ..... 
    

提交回复
热议问题