BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ender111
Obsidian | Level 7

What I am trying to do is use a control on a visual to manually assign a variable that a SAS program can reference before a different report is opened.

is that possible?  Can a button or drop down be used to store a macro variable somewhere that can be used by either a SAS program or a data plan? 

I do not mean using a button or drop down to assign a parameter to be used by a visual.  It needs to be used by a program or data plan.

1 ACCEPTED SOLUTION

Accepted Solutions
KeithM
SAS Employee

The easiest way to accomplish this is to create an action from the VA object that links to a SAS Job.  For example, below I have a list table.  When I click on the actions, I can link to a URL.

KeithM_0-1673378160733.png

 

When adding the URL, paste in the URL for your job execution (http://YourVAServer.com/SASJobExecution).  You then have the option to add a parameter.   The parameter will be tacked on at the end of your URL, so in your SAS code for the job, you can just reference the parameter like a normal macro variable.

KeithM_1-1673378424114.png

 

 

 

 

 

View solution in original post

8 REPLIES 8
ender111
Obsidian | Level 7

Stored Process is supposed to be available in the object menu under "Other", but is not present in my installation.  Is there some other way to access a stored process via button or drop down object or assign a macro execution through a control on a visual or other object?

Madelyn_SAS
SAS Super FREQ

Which version of Visual Analytics are you using? 

ender111
Obsidian | Level 7
SAS VA 8.5.1.
KeithM
SAS Employee

The easiest way to accomplish this is to create an action from the VA object that links to a SAS Job.  For example, below I have a list table.  When I click on the actions, I can link to a URL.

KeithM_0-1673378160733.png

 

When adding the URL, paste in the URL for your job execution (http://YourVAServer.com/SASJobExecution).  You then have the option to add a parameter.   The parameter will be tacked on at the end of your URL, so in your SAS code for the job, you can just reference the parameter like a normal macro variable.

KeithM_1-1673378424114.png

 

 

 

 

 

ender111
Obsidian | Level 7
This is amazing. How do you reference the parameter in your code coming from the URL?
KeithM
SAS Employee
Below is a very simple job. From the previous example, I'm passing in make. You reference make using &make in your SAS code. Put it in double quotes to evaluate.


* Write the custom HTML to _webout;

%global make;

data _null_;
file _webout;
put '<html>';
put '<head><title>Hello World!</title></head>';
put '<body>';
put "<h1>The selected car is: &make</h1>";
put '</body>';
put '</html>';
run;
ender111
Obsidian | Level 7
Thanks, Keith. This was perfect. I had some trouble with assigning the variable on the URL end, but it was just necessary to input the optional target fields, then everything worked great. Job Execution was new for me so that took some getting used to, but is a very nice complement to report generating. Thanks again!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 8 replies
  • 696 views
  • 4 likes
  • 4 in conversation