BookmarkSubscribeRSS Feed
Hello_there
Lapis Lazuli | Level 10

Hi,

 

I've been tasked with a project where I have to take rather long SAS program using PCSAS (v. 9.4), and create a user application, similar to an R Shiny App.

 

It should be able to take input parameters, and will output statistics and graph visuals.

 

What is the best way to this?

 

Would it just be easier to just translate my code into R code and create an R shiny app?

13 REPLIES 13
Stu_SAS
SAS Employee

What you are looking for on SAS 9.4 is called a Stored Process (STP). Stored Processes accept user input, produce graphs, and even allow you to download results. They're highly flexible. You can build whole webpages for them that accept user input, or you can use the pre-built stored process interfaces that are generated by creating prompts in the metadata server.

 

You can create these with Enterprise Guide or through the Stored Process Server, which would be the most ideal way of handling it because you can have a nice web interface to produce graphics. A great paper on this subject:

Create Your First SAS Stored Process

 

If you have Visual Analytics, you can bring together both Stored Processes and dashboards together so that you can create a dashboard that displays the results of your job.

 

In SAS Viya, the equivalent of a Stored Process is called a Viya Job. It's extremely similar to a Stored Process in 9.4. An example of this can be found in this paper:

Modernizing Scenario Analysis With SAS Viya and SAS Visual Analytics 

Hello_there
Lapis Lazuli | Level 10
Thanks for the idea. I found out that I have SAS EG on my computer, and I’m trying to practice creating a stored process with a simple program.

An error box pops up and says:
“One or more items in the process flow cannot be included in the sas program…”

And then another box pops up and says
“SDS failed to provide the user context. Active OMSProvider is required.”

Do you know what possible reasons this could be?
SASKiwi
PROC Star

If you only have PC SAS and no remote SAS server then I don't think stored processes are an option. You could go really old-school with the SAS Windowing Environment and the WINDOW statement. It will look very old-fashioned but is easy to understand and implement.

Hello_there
Lapis Lazuli | Level 10
If i did it the way you suggested, would it be possible to still create an APP out of it so someone could access it remotely without SAS?
Patrick
Opal | Level 21

Also with R Shiny you would typically require a server component for shared reports. 

Typically PC SAS refers to a locally installed SAS. SAS EG is a client that can connect to both SAS installed on a server or locally. 

SAS EG allows you to define prompts. These prompts become then available as SAS macro variables that you can use in your code. For this to work your user needs the SAS EG project opened where the prompts are defined and of course access to the SAS code to be run. 

That's o.k. for some user specific adhoc processes but not really how one should share "published" reports. If using SAS EG with a local SAS "server" each user needs to have this local SAS installation plus must be using the EG project where the prompts are defined. 

Try and figure out if there isn't a server version of SAS available that will allow you to build this in a proper way (either via SAS Visual Analytics and/or stored processes).

Hello_there
Lapis Lazuli | Level 10
Thanks for your response.

The goal is to be able to have this application be accessed by other people remotely (in some instances, maybe without having SAS or R installed).

If I were to try and recreate the code w/ R and try to put into an R shiny app and use it as a shared resource with someone else remotely, are you saying that I would still need some type of server? The code for the app doesn't depend on data sets. The app is a special kind of calculator.
SASKiwi
PROC Star

The only way to do remote access with the software you currenly have would be to allow remote logons to your PC using the Windows Remote Desktop Connection. Then they could start a SAS session and run your SAS application. This could be problematic if you are using your PC at the same time. Many organisations restrict multi-user access to PCs and indeed remote access. A better option would be a virtual PC set up in your data centre, if that is a possibility.

Patrick
Opal | Level 21

The goal is to be able to have this application be accessed by other people remotely

And that's what you need a server for. 

The approaches @SASKiwi mentions (remote desktop or virtual PC) are both not only sub-optimal but would likely also breach the SAS license. From memory PC SAS licenses are per user and though you would need as many licenses as there are users accessing your application.

 

SASKiwi
PROC Star

@Patrick - Very valid points, although it may be possible to negotiate a low multi-user licence. We have something similar with our SAS Dataflux Studio licence which is limited to 3 non-dedicated users. But I agree that a server-based solution is the ideal way to go.

Hello_there
Lapis Lazuli | Level 10
Thanks for replying, this helps me shine light on my situation.
subhashmantha
Fluorite | Level 6

There is no one way to do it. It really depend on the options you have at your disposal.

1. Just base SAS at your disposal you can leverage the command line scripting of your environment, sas sysparms option to take user inputs and run the program

2. Just base SAS at your disposal you can leverage python or perl or any other programming language, sas sysparms option to take user inputs and run the program

3. SAS/AF or SAS/SCL at your disposal you can build an interactive app. to take user inputs and run sas programs. If multiple users are using the same app from the same location things might get a little tricky

4. SAS EG and SAS studio have options of a stored process. I am not very familiar with Nuances around them.

spartacourse
Calcite | Level 5

Im in the same spot. Had to use Shiny R. But I am still looking for a way to use SAS. I also have SAS enterprise but no Viya. I am thinking of wrapping in saspy and build with python, dockerize and deploy

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 13 replies
  • 2682 views
  • 13 likes
  • 6 in conversation