BookmarkSubscribeRSS Feed

Using SAS Enterprise Guide with SAS Viya 4

Started ‎03-22-2024 by
Modified ‎03-26-2024 by
Views 2,327

The latest version of SAS Enterprise Guide, version 8.4 released in March 2024, now adds support for SAS Viya 4. This allows you to continue using your Windows desktop client and now have your SAS Enterprise Guide projects run against a SAS Viya 4 compute server and incorporate new SAS Viya 4 capabilities into the project as well. 

 

Here is a quick overview of what it entails to run your SAS Enterprise Guide project against a SAS Viya 4 server: 

  1. Defining a Viya 4 connection  
  2. Updating tasks in a SAS Enterprise Guide Process Flow to use a Viya 4 connection 
  3. Running those updated tasks  

You can also watch a demonstration of these steps that we featured on the SAS Viya Release Highlights show.

Defining and using a SAS Viya 4 connection

Defining the connection to SAS Viya Compute Server

In SAS Enterprise Guide select Tools -> Connections and navigate to the Servers panel 

WilbramSAS_0-1711107624978.png

 

Click on the Add button to open the SAS server connection definition window. 

 

WilbramSAS_1-1711107673934.png

 

 For a SAS Viya 4 connection you use a URL instead of a machine name. You will notice that when you start typing https: in the Machine name or URL field, the Port field is greyed out and the Compute Context Name field becomes editable and defaults to SAS Studio compute context. This compute context is the default SAS Viya 4 compute server definition that is also used by SAS Studio and a compute context represents configuration items like default assigned SAS libraries and autoexec. 

 

If your SAS Viya 4 environment is running SAS Viya 2024.02 or later, this is all you need to do before you can start using the connection. 

 

When connecting to an earlier version of SAS Viya 4, your SAS Administrator will need to define a Client ID and Client secret and provide that info to you. You will then need to enter this information by clicking on the Advanced … button shown in the screenshot above. This will open the following window where that information can be entered: 

WilbramSAS_2-1711107673936.png

 

More details can be found in the following SAS documentation: SAS Viya Platform Administration - Register an OAuth Client ID 

 

Using a Viya 4 connection 

Note: A SAS Studio Analyst license is needed on the SAS Viya side for the Viya 4 connection to work.

Now that the connection has been defined, it will show up in the Servers panel. Simply select a server and double-click on it, or select Connect from the popup menu. This will open a tab in your default web browser showing a SASLogon window asking for user credentials(*). Once credentials have been accepted the web browser tab will show an Authorization Code. 

 

WilbramSAS_3-1711107774751.png

 

(*) If the SAS Viya 4 environment has been configured for Single Sign-On (SSO) the prompt for credentials will be skipped. 

 

Select this Authorization Code and copy it to the clipboard, then paste it into the Authenticate with SAS Viya panel that opened in SAS Enterprise Guide and click on OK. 

 

WilbramSAS_4-1711107774752.png

 

SAS Enterprise Guide will now start a SAS Viya 4 compute session and you can navigate the list of SAS Libraries and navigate the file system attached to the SAS Viya 4 Compute Server. 

 

WilbramSAS_5-1711107830946.png

 

Just as with SAS 9 connections, you can expand SAS libraries and view the contents of tables. Also filtering rows in the table viewer is supported. Please note that for SAS Viya connections the table viewer is read-only. 

 

Known restrictions when using a Viya 4 connection 

When running an existing SAS Enterprise Guide project against a SAS Viya 4 connection, any features in SAS Enterprise Guide that rely on SAS Metadata are not available. See Working without a Metadata Server Connection in the SAS Enterprise Guide User’s Guide for more details. 

 

Updating tasks in a Process Flow to use a Viya 4 connection 

We are now going to modify an existing SAS Enterprise Guide project created by SAS Enterprise Guide 8.3 that uses connections to multiple SAS 9 servers. SAS Enterprise Guide 8.4 can read SAS Enterprise Guide projects created by older releases. 

 

We will first modify the individual tasks in the SAS Enterprise Guide process flow and change the server association to point to our SAS Viya 4 server, and then show an alternative approach where all tasks in a flow are using SAS Viya 4 server with just a few mouse clicks using the project maintenance wizard. 

 

The screenshot below shows an existing SAS Enterprise Guide project that was created using version 8.x and we’ve started with the first task in the process flow. We’ll modify this Program task by changing its server association from a remote SAS 9 server (windows) to our SAS Viya 4 server. We’ll do this as follows: select the Task, then right-mouse click -> Select server and then select the SAS Viya 4 server from the list of available servers.  

 

WilbramSAS_0-1711108168568.png

 

 After having changed the server association, we will run the task to check that it still runs okay. Select Run from the popup menu of the Program task. 

 

WilbramSAS_1-1711108168570.png

 

As this task now creates a table on the SAS Viya 4 server, a new Data task will be created having an association with the SAS Viya 4 server. You can see the server association when you hoover the mouse over the Data task, or when you open the Properties window of the Data task. 

 

WilbramSAS_2-1711108168570.png

 

 We now need to update the input data for the Random Sample task to use this newly created table. Therefore, select task Random Sample and choose Select input data -> SEDANS from the task menu. 

 

WilbramSAS_3-1711108168571.png

 

 This will connect the SEDANS Data task to the Random Sample task. The orphaned SEDANS Data task, using the SAS 9 server connection, can now be removed from the flow.  

 

Similarly, we’ll now run the Random Sample task. It will create a new version of the SAMPLED Data task and we need to repeat the approach we used before to connect that table to the subsequent task, followed by removing the orphaned Data task. And then do this for all other tasks in the flow.  

 

This approach allows for very granular testing, but at the same time requires manually updating all the tasks in the flow. An alternative approach is using the Project Maintenance wizard which allows to change all server associations in a project with just a few mouse clicks. We will explain this in detail in the next section. 

Using the SAS Enterprise Guide Project Maintenance wizard to update server associations

When wanting to modify server associations for all tasks in a flow, the Project maintenance wizard is extremely useful as it allows to do this with just a few mouse clicks. The wizard can be invoked using Tools -> Project maintenance while an existing project is open. 

 

WilbramSAS_4-1711108309547.jpeg

 

The Project Maintenance wizard lists all the server connections used in all process flows in the currently open SAS Enterprise Guide project. Select the server that needs to be replaced, and then use button Replace in Project, and select the server to use from the Replace SAS Execution Server panel. 

 

WilbramSAS_5-1711108309548.png

 

 In our example the project uses two different SAS 9 servers, so we repeat this for the other server as well. Now that all server associations are using the SAS Viya 4 server, you will only see a single server listed. Note that the server remapping has also been applied to all Data Items that were using the server, as can be seen in the following screenshot.  

 

WilbramSAS_6-1711108309548.png

 

We can now exit the wizard and run the saved project. In the Submission Status panel below, we see that all tasks ran on our SAS Viya 4 server. 

 

WilbramSAS_7-1711108309549.png

 

Note: There is also the SAS Enterprise Guide Migration Wizard that allows to use to apply project maintenance to a collection of projects.  (It's also useful for migrating a collection of older EGP files to the latest version of project files.) This will allow for replacing server associations, and/or SAS libraries for all projects in a folder with support for recursively traversing all subfolders. The program is called MigrationWizard.exe and can be found in the SAS Enterprise Guide installation directory. More details can be found in SAS Enterprise Guide Migration Wizard. 

 

Using SAS Viya 4 capabilities in a SAS Enterprise Guide project 

When using a connection to SAS Viya 4, the SAS code generated by SAS Enterprise Guide runs on a SAS Viya 4 compute server. This means that we can use Program tasks that contain for example proc python calls to embed Python logic in your SAS program, or  SAS language statements that initiate a connection with SAS Cloud Analytics Services, CAS for short, and run data steps that run in parallel on CAS, invoke CAS actions that for example run advanced analytics algorithms available on CAS, etc.  

 

When such SAS code generates reports, the report will be visible in the Results panel in SAS Enterprise Guide. Here is a simple example that demonstrates this. 

 

WilbramSAS_8-1711108571450.png

 

Conclusion 

SAS Enterprise Guide 8.4 is a Microsoft Windows client application that provides the same user interface as previous SAS Enterprise Guide 8.x releases. The latest version provides integration with SAS Viya 4, allowing existing SAS Enterprise Guide projects to run against a SAS Viya 4 server and allowing for embedding new SAS Viya 4 capabilities, like Python support and advanced analytics, into existing SAS Enterprise Guide projects.  

Learn more

Version history
Last update:
‎03-26-2024 11:12 AM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags