Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Question: Macro Variables in SAS Visual Analytics

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Question: Macro Variables in SAS Visual Analytics

Hi everyone,

     I've found a sas file in my server, it is a DataSetVarsToMacroVars.sas file. In this file it says that "Purpose : Converts values of columns in a data set to macro variables values".

     Did it means we can use macro variables in SAS Visual Analytics? If yes, how and where can we use the assigned macro variables?

Thanks for helping.

Attachment

Accepted Solutions
Solution
‎08-25-2014 10:42 AM
SAS Employee
Posts: 19

Re: Question: Macro Variables in SAS Visual Analytics

Hello siewtongl,

Currently we do not support the use of SAS created macro variables directly within Visual Analytics.  However, you can leverage a stored process via Visual Analytics.  In the stored process, you can definitely call a macro variable within that context.  If you then had an output that would create a LASR table your output with Macro Variables could be utilized in LASR via Visual Analytics.  However, you can not not natively call that Macro Variable inside Visual Analytics.  I would be very interested in your use case in calling the macro variable inside VA.  If you can let me know what you had in mind that would be great.

Regards,

Ted Werner

View solution in original post


All Replies
Solution
‎08-25-2014 10:42 AM
SAS Employee
Posts: 19

Re: Question: Macro Variables in SAS Visual Analytics

Hello siewtongl,

Currently we do not support the use of SAS created macro variables directly within Visual Analytics.  However, you can leverage a stored process via Visual Analytics.  In the stored process, you can definitely call a macro variable within that context.  If you then had an output that would create a LASR table your output with Macro Variables could be utilized in LASR via Visual Analytics.  However, you can not not natively call that Macro Variable inside Visual Analytics.  I would be very interested in your use case in calling the macro variable inside VA.  If you can let me know what you had in mind that would be great.

Regards,

Ted Werner

New Contributor
Posts: 3

Re: Question: Macro Variables in SAS Visual Analytics

I have a project in VA where I need to restrict user data viewed, but not the graphs and charts etc. that are in the report.

If I could call, for example, "&SYSUSERID" , I could match that user id to a column in my data set that would limit what the end user can see.

The only other alternative is to create different reports, one for each "user group", with all the same content. This is not preferred, as I would have to change each report whenever a change was called for. It would be better to be able to control what the end user sees by identifying who is logged in, then in the where clause, restrict the rows they can see. 

 

In my particular implementation, the hierarchy would look like this

    district administrators can see all schools

    principals can only see their school and district aggregated data

    teachers can only see their students, then school and district aggregated data.

 

 

Super User
Posts: 1,202

Re: Question: Macro Variables in SAS Visual Analytics

Hi @cuevasj,

 

While there isn't the concept of SAS macros for user identification, it is possible to apply conditional grants on your table and have row-level security imposed to achieve what you're after. If you want your graphs and charts not to have row-level security though, you would need to have 2 versions of the table, one with row-level security and use this in your tables/cross-tabs and the standard table in your charts/graphs. Be aware though the aggregated figures will be different due to the subsetting imposed.

 

Please note if you allow the export data option from your graphs/charts ALL your end-users will be able to export and see the underlying data for all schools. So you may want to restrict this capability or ensure row-level security is consistent across all report objects.

 

Some reference SAS Global Forum papers that you may find useful:

 

Kind Regards,

Michelle

Post a Question
Discussion Stats
  • 3 replies
  • 768 views
  • 0 likes
  • 4 in conversation