sassas-metadata

Autocall macro %mdsecds() generates syntax error


As per documentation, the mdsecds macro generates a series of datasets showing the permissions levels applied for each metadata object.

We load this data into a database, to allow drill down (via a web app) to uncover fine grained permissions for any metadata object.

The below was working fine until yesterday:

%mdsecds()

But now we get:

MPRINT(MDSECTR):   proc transpose data=work.mdsecds_permsl out=work.mdsecds_permsw(drop=_name_);
MPRINT(MDSECTR):   by objname objuri identitydispname identityname identitytype;
MPRINT(MDSECTR):   id permission;
MPRINT(MDSECTR):   var authorization;
MPRINT(MDSECTR):   run;

NOTE: There were 4929844 observations read from the data set WORK.MDSECDS_PERMSL.
NOTE: The data set WORK.MDSECDS_PERMSW has 827938 observations and 20 variables.
NOTE: Compressing data set WORK.MDSECDS_PERMSW decreased size by 78.40 percent. 
      Compressed is 11921 pages; un-compressed would require 55197 pages.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           36.12 seconds
      cpu time            35.15 seconds


MPRINT(MDSECDS):  ;
MPRINT(MDSECVW):   proc sql;
NOTE: Simple index objuri has been defined.
NOTE: Composite index users has been defined.
NOTE: Simple index objuri has been defined.
NOTE: Composite index name has been defined.
NOTE 137-205: Line generated by the invoked macro "MDSECVW".
18         (location, objname, publictype, ObjId);           create view &targdata as          select &objcols, &trancols from
                                                                                                                          ____
                                                                                                                          22
18       ! &trandata a inner join &objdata b on a.objuri=b.objuri             order by location, objname, publictype, objid,
18       ! identityname,
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING, 
              INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, USING, WHERE.  

NOTE: Line generated by the invoked macro "MDSECVW".
18         (location, objname, publictype, ObjId);           create view &targdata as          select &objcols, &trancols from
                                                                                                                          ____
                                                                                                                          76
18       ! &trandata a inner join &objdata b on a.objuri=b.objuri             order by location, objname, publictype, objid,
18       ! identityname,
ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the macro variable "TRANCOLS".
18          a.identitydispname, a.identityname, a.identitytype, a.CheckInMetadata, a.ReadMetadata, a.WriteMetadata, a.Administer,
18       ! a.Create, a.Delete, a.Read, a.Write, a.WriteMemberMetadata, a.Alter Table, a.Create Table, a.Drop Table, a.Insert,
                                                                               _____
                                                                               22
18       ! a.Select, a.Update
MPRINT(MDSECVW):   create index objuri on work.mdsecds_permsw(objuri) create index users on work.mdsecds_permsw(objuri, 
identitydispname, identityname, identitytype) create index objuri on work.mdsecds_objs(objuri) create index name on 
work.mdsecds_objs(location, objname, publictype, ObjId) create view work.mdsecds_join as select b.ObjId, b.ObjName, b.Location, 
b.MetadataType, b.PublicType, b.Desc, b.ParentObjId, b.MetadataCreated, b.MetadataUpdated, b.ObjUri, b.Permissions, 
a.identitydispname, a.identityname, a.identitytype, a.CheckInMetadata, a.ReadMetadata, a.WriteMetadata, a.Administer, a.Create, 
a.Delete, a.Read, a.Write, a.WriteMemberMetadata, a.Alter Table, Table, a.Drop Table, a.Insert, a.Select, a.Update from a inner 
join work.mdsecds_objs b on a.objuri=b.objuri order by location, objname, publictype, objid, identityname, identitytype;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, AS, 
              CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.  

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
MPRINT(MDSECVW):   quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           17.54 seconds
      cpu time            23.78 seconds

Looks like a similar issue was found here, but providing a folder is unpalatable as we want all metadata objects.

The code is running via EG 5.1 (SAS 9.3 Windows platform) using an admin account (so is able to access all the metadata, no other ERRORs / WARNINGs were generated).

What is the likely cause of the error?


Solution

  • Looking strictly at this.

    a.Alter Table, a.Create Table, a.Drop Table,
    

    it looks like these names should be name literals.

    a.'Alter Table'n, a.'Create Table'n, a.'Drop Table'n,
    

    Assuming that is the problem the question remains how to make that happen.