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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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