BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
siewtongl
Calcite | Level 5

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.


Capture.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
ted_werner_sas_com
SAS Employee

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

3 REPLIES 3
ted_werner_sas_com
SAS Employee

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

cuevasj
Quartz | Level 8

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.

 

 

MichelleHomes
Meteorite | Level 14

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

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2346 views
  • 0 likes
  • 4 in conversation