Desktop productivity for business analysts and programmers

Add In : GetSasMacroValue : C#

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Add In : GetSasMacroValue : C#


I am using C# and have played with some of the examples with success.

I would like to read a macro variable, and have attempted the following two statements.   The result is that the addin compiles and runs but does not return the value of the macro variable within the add in.

SasServer server = new SAS.Tasks.Toolkit.SasServer(Consumer.AssignedServer);          

test = server.GetSasMacroValue("MCRNME");

Does anyone have a working example they would like to share of this method?



Accepted Solutions
Solution
‎04-12-2012 02:31 PM
Community Manager
Posts: 2,887

Re: Add In : GetSasMacroValue : C#

That should work, just as you have it, as long as the macro variable exists.

Try this example and see if the macro variable you're looking for is there:

http://blogs.sas.com/content/sasdummy/2011/11/22/inspecting-sas-macro-variables-in-sas-enterprise-gu...

Chris

View solution in original post


All Replies
Solution
‎04-12-2012 02:31 PM
Community Manager
Posts: 2,887

Re: Add In : GetSasMacroValue : C#

That should work, just as you have it, as long as the macro variable exists.

Try this example and see if the macro variable you're looking for is there:

http://blogs.sas.com/content/sasdummy/2011/11/22/inspecting-sas-macro-variables-in-sas-enterprise-gu...

Chris

New Contributor
Posts: 2

Re: Add In : GetSasMacroValue : C#

Just a follow up question.  Of the examples all look to use a TaskForm to actually execute the task.  I have a simple task that I am doing an do not need to expose a windows interface, but do need a custom task (.NET).  I just need it executed in the process flow.

How is the SAS interface to be executed without a TaskForm in use?

Community Manager
Posts: 2,887

Re: Add In : GetSasMacroValue : C#

In the Task class Show() method (which you override from the SasTask class), simply return ShowResult.RunNow, without creating/showing the form.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 304 views
  • 3 likes
  • 2 in conversation