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


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?


1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

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

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

3 REPLIES 3
ChrisHemedinger
Community Manager

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

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
DLARLICK
Calcite | Level 5

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?

ChrisHemedinger
Community Manager

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

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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