3

I'm trying to access the names of the creators (or person who last updated the report) of the reports in SAS VA without checking in the creators of the physical files on the server, which are not accessible for me. Is this sort of data stored in METADATA?

I used the %MDSECDS macro to access the metadat, and the automatically createrd MDSECDS_OBJS table containst most of the data I need, but creator of the report is not amongst them.

Is there a way to access the name of the person, who created or updated the report is SAS VA (would be great to obtain it using EG)?

Thanks!

Łukasz Stasiak
  • 107
  • 1
  • 2
  • 11

1 Answers1

3

Yeah, its possible.

%let report_name=NAME_OF_REPORT;

data report_info;
    length uri  Respuri 
        $256 
        Date
        Name
        Role
        $40
    ;
    n_rep=metadata_getnobj("omsobj:Transformation?@Name contains '&report_name'",1,uri);

    do iter_rep=1 to n_rep;
        rc=metadata_getattr(uri, "MetadataCreated", Date);
        passn=metadata_getnasn(uri,"ResponsibleParties",1,Respuri);
        rc=metadata_getattr(Respuri, "Role", Role);
        rc=metadata_getattr(Respuri, "Name", Name);
        output;
        rc=metadata_getattr(uri, "MetadataUpdated", Date);
        passn=metadata_getnasn(uri,"ResponsibleParties",2,Respuri);
        rc=metadata_getattr(Respuri, "Role", Role);
        rc=metadata_getattr(Respuri, "Name", Name);
        output;
    end;

    keep date name role;
run;

return

+--------------------+-------------+-------------+
|        Date        |    Name     |    Role     |
+--------------------+-------------+-------------+
| 19Jun2017:13:24:18 | UserName1   | Created By  |
| 26Jul2017:11:28:07 | UserName2   | Modified By |
+--------------------+-------------+-------------+

Also, you can view all meta objects by using SAS Metadata Browser.

sas.exe -> "Solutions" tab -> Accessiories -> Metadata Browser

enter image description here

Sanek Zhitnik
  • 716
  • 1
  • 10
  • 25