BookmarkSubscribeRSS Feed

Get connection information for a SAS9 server in Enterprise Guide and use it in VS Code

Started a week ago by
Modified a week ago by
Views 338

The other day someone asked me how can I connect from the SAS extension in VS Code to the same workspace servers I can see in Enterprise Guide. Using the information from the profile used in Enterprise Guide did not work. So it seems those two applications work slightly different.

 

This post will provide a step by step guide how to lookup the information in Enterprise Guide and use it when defining a new connection in the SAS extension for VS Code.

 

 

What we will cover

 

  • What the Enterprise Guide connects to
  • What the SAS extension in VS Code connects to
  • Get the info from Enterprise Guide and use it in the SAS extension

 

 

What the Enterprise Guide connects to

 

Looking at the profile definition in Enterprise Guide we see the following screen:

 

01_brm-eg2code-eg-profile.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

 

Let's look at the information in the boxes. The profile has a name, it connects to a machine using a specific port number and it might store userid and password to authenticate. The machine name and port number point to a SAS Metadata Server. The Enterprise Guide will then communicate with the SAS Metadata Server and retrieve the SAS servers the user has access to. This information is then shown in the Servers window within the Enterprise Guide.

 

02_brm-eg2code-eg-server-list.png

 

In our case, two servers where read from the Metadata server. We can see, that they are SAS 9 based. The others in the list are connections to SAS Viya servers or SAS Workbench Servers. The Metadata server provided the information so that the Enterprise Guide knows how to connect to either the SASApp or the SASAppU server.

 

 

What the SAS extension in VS Code connects to

 

Let's look at the information needed for a SAS 9.4 (remote – IOM) connection profile in the doc for the SAS extension for VS Code.

 

03_brm-eg2code-code-connection-information-1024x534.png

 

We can see we also need a hostname (1) and a port number (2). Similar to what we have in the Enterprise Guide profile. However, these do not point to a SAS Metadata Server, but point to a SAS Workspace Server. We will see later where we get this information from. We can specify a username (3) but no password, we will be prompted for the password once we connect.

 

In order to use this connection type, certain prerequisites are need: To use a SAS 9.4 (remote – IOM) connection type, you need to install both SAS Integration Technologies Client for Windows (ITCLIENT) and the SAS Providers for OLE DB on the client machine where VS Code is installed. The order of installation does not matter.

 

Check the documentation for more details.

 

 

Get the info from Enterprise Guide and use it in the SAS extension

 

For the SAS extension we do need the hostname and port number for a specific server. This information is readily available within the Enterprise Guide. We use the right mouse button and select properties on a server to then see this information. The screenshot below shows the properties of the two servers SASApp and SASAppU side by side.

 

04_brm-eg2code-eg-server-prop.png

 

We can see that the hostname is the same, but each server has a different port number. Using this information we can now define a new connection profile in VS Code.

 

In VS Code we use F1 or Ctrl+Shift+P on Windows or Shift+CMD+P on macOS to display the  command palette.

 

We search for "sas: add"

 

05_brm-eg2code-show-add-command.png

 

We select the "SAS: Add New Connection Profile" command and are guided to enter, the profilename, the connection type, the hostname, the port number and finally the userid. The hostname and port number can conveniently be copied from the properties windows of server in Enterprise Guide.

 

06_brm-eg2code-show-add-step-by-step.png

 

As it says in the first prompt you can edit the settings.json file to add a new connection profile. To get there use the command palette (Ctrl+Shift+P) and search for "Preferences: Open User Settings (JSON)" an editor for the settings.json file is displayed.

 

07_brm-eg2code-settings-json.png

 

The last connection profile added is the current active one. You could also copy/paste the contents of a given profile and add a new one by making some changes. This might be easier. To be on the save side go with "SAS: Add New Connection Profile" command. You do have additional sas profile commands available, see below.

 

08_brm-eg2code-profile-commands.png

 

The active profile name is displayed in the status bar of VS Code.

 

09_brm-eg2code-active-profile.png

 

You are ready to use this connection profile. Check out the resources in the summary section on how to use the SAS extension in VS Code for SAS program development and more.

 

 

Summary

 

We have seen that it is easy to get the information that is needed to create a connection profile in the SAS extension for VS Code pointing to a server you use in Enterprise Guide.

 

To get more familiar on using the SAS extension for VS Code I do recommend these:

 

 

 

Find more articles from SAS Global Enablement and Learning here.

Comments

Thanks for this summary @BrunoMueller! I wish I had something like this when I was going my path from EG to VS Code for the first time.

@yabwon glad you found it helpful. Too bad it came to late for you. BTW, just recently I watched your SASinnovate presentation on SAS packages. Thanks for that.

 

@BrunoMueller, there is non-zero probability that in the future I'll be getting back here to remind myself  the process. And for sure redirect here others!

 

About the Innovate recording, I'm happy you found the presentation interesting. I'm always ready to talk about SAS packages 😄

Contributors
Version history
Last update:
a week ago
Updated by:

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags