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

I'm considering linking a new custom task, written in VB.NET, to a specific SAS license, so I will need a quick way to get the site number of the active server, so I can check it whenever the custom task is opened.

If I use Consumer.ActiveServer, is there a quick way to get the site number of that active server?

...........Phil

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Phil,

You can get it this way:

Dim sasServer as New SAS.Tasks.Toolkit.SasServer(Consumer.AssignedServer)

sitenum = sasServer.GetSasMacroValue("SYSSITE")

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

7 REPLIES 7
prholland
Fluorite | Level 6

FYI I know that the information I need is in &syssite.  I just don't know how to get this information quickly (and easily).

............Phil

ChrisHemedinger
Community Manager

Phil,

You can get it this way:

Dim sasServer as New SAS.Tasks.Toolkit.SasServer(Consumer.AssignedServer)

sitenum = sasServer.GetSasMacroValue("SYSSITE")

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!
prholland
Fluorite | Level 6

That was a lot easier than I had expected.

Many thanks...........Phil

EDWARD1019
Calcite | Level 5

Hi Chris, could you do me a favor?

I just install Base SAS9.3 and SAS Enterprise Guide 5.1; While whenever I run SAS EG, it says no profile selected. While when I try to add an profile and set it active. It always pops up "an unexpected error...". How should I set up the server for EG and use it normally?

ChrisHemedinger
Community Manager

If you have SAS 9.3 installed on the same Windows machine as EG, you don't need to do anything additional.  You should already have a server named "Local" that uses your local SAS instance automatically.

"No profile" means no metadata profile is configured.  You need a metadata profile only if you are going to connect to a remote SAS session.

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!
EDWARD1019
Calcite | Level 5

Hi Chris, thx for your reply. How's going today.

The reason why I am trying to find and connect to a remote free open server is because, although SAS9.3 is installed while I cannot run command on sas enterprise guide. ERROR MESG is like : a connection to server 'local' could not be established.

I checked a lot of troubleshooting method mentioned on SAS web, while problem is still there. Do you have any idea of that?

ChrisHemedinger
Community Manager

Check Help->About SAS Enterprise Guide, and click Configuration Details

You'll see a window like this:

local.png

If it doesn't show a "SAS System version" or "SAS System command", then you don't have a properly installed version of SAS.

If you know for certain that you have SAS installed, try running this command from a command prompt:

"c:\program files\sashome\sasfoundation\9.3\sas.exe" -regserver

(Changing the path to where your SAS.EXE is installed.)

You won't see any message from the command, but after running it try restarting SAS Enterprise Guide and see if you can see a "Local" SAS server.

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!

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
  • 7 replies
  • 2804 views
  • 1 like
  • 3 in conversation