BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

I am trying to understand how to use Viya to run non-interactive ("batch") programs.

 

For the past 40 or so years to run a program you would open a terminal window and type the command sas followed by the name of file with the SAS program.  SAS would run the program and generate a Log and Listing (and whatever other files your program created).

 

It worked this way on VAX/VMS, VM/CMS, DOS, OS/2, Windows, Unix.  It has worked this way in our SAS Grid environment for the past xxx years.

 

So now that I have access to SAS Viya I see that it has a command line tool named sas-viya that has a concept called batch that appears to be able to do the same thing.  The syntax is different, but I can adapt to that. 

 

But what is confusing me is that it seems to have its world view the relative safety of interactive versus non-interactive jobs backwards.  When I sign in interactively to SAS/Studio I have much more freedom to see things and change them than I do when submitting non-interactive jobs.  That seems backwards to me.  Interactive sessions are for exploring and figuring out what you want your standard programs to do.  And non-interactive sessions are where you run your production jobs so that you are sure to have a clear and complete log.

 

Before I complain to our local support team about the environment they have setup I would like to see if I am just not getting it.

 

Is there perhaps some other way to run SAS programs in VIYA from the command line?

7 REPLIES 7
Tom
Super User Tom
Super User

Thanks. Those examples help understand how to use the commands.

 

But I am looking more for understanding the "philosophy" or the "design" or "mental model" of it all.

 

To me it looks like this is attempting to treat SAS as a foreign computer system you need to interact with.   I am used to a system where SAS is just another tool in the tool box along with grep, bash and other Unix tools.  

sbxkoenk
SAS Super FREQ

@Tom wrote:

So now that I have access to SAS Viya I see that it has a command line tool named sas-viya that has a concept called batch that appears to be able to do the same thing.  The syntax is different, but I can adapt to that. 

 

But what is confusing me is that ...


Unfortunately this is not an answer that will take away your confusion.

I just want to put some links here for people wanting to use the "SAS Viya Command Line Interface Plug-ins". And more specifically the batch plug-in.

 

How to Run SAS Programs in Batch in the New SAS Viya
Started ‎07-APR-2021 | Modified ‎05-JUN-2022 | Views 22,580
by Bogdan Teleuca
https://communities.sas.com/t5/SAS-Communities-Library/How-to-Run-SAS-Programs-in-Batch-in-the-New-S...

 

SAS Help Center: Set Up the batch Plug-in

 

Ciao,

Koen

Tom
Super User Tom
Super User

Sounds to me like it more of a configuration issue.  To get SAS to run on a GRID of nodes we had to make sure the needed disks were properly mounted on all of the execution nodes in the grid cluster so the SAS programs could find the files they needed. 

 

Sounds like we need to configure our "pods" and "contexts" so they also have access to the files they need.

gwootton
SAS Super FREQ
Hi Tom,
Yes, in the Viya Platform the SAS session is running inside of a container so it's file system is controlled. The batch plugin to the sas-viya CLI lets you pass your program and optionally other files that will be staged inside the batch server, and retrieve the results either by waiting for the job to complete or by requesting them later.
The batch plugin can also be used to run SAS interactively in line mode, and to run commands from within the cluster rather than SAS.
If the code you are submitting is referencing a path as a data source and you aren't uploading that file as part of the submission, that path would need to be mounted into the container so the SAS session has access to it. This would be true for compute servers like those used by SAS Studio, SAS/CONNECT servers, and batch servers used by the batch CLI. The supplied example transformer $deploy/sas-bases/examples/sas-compute-server/compute-server-add-nfs-mount.yaml and its associated README.md provide an example for mounting an NFS server share into the pods that run SAS code. This could be modified to use a different volume type like a PersistentVolume, or to target a subset of the SAS podtemplates used by the various servers (e.g. only mount this into batch servers and not compute and connect servers).

--
Greg Wootton | Principal Systems Technical Support Engineer
Tom
Super User Tom
Super User

That makes sense.  Where can I read more about this (I am not the actual installer here, just user).

 

The default context where you have to upload everything and download the results does not seem like a very practical setup.

 

Are there some worked examples of typical (or suggested) setups for configuring your Viya containers so they integrate more seamlessly into the larger network of computers and storage used in an organization? 

 

 

gwootton
SAS Super FREQ
From the perspective of a user I think what you'd need to provide to the administrator is what path(s) your SAS sessions need to be able to access. The administrator should be able to modify the deployment to make those paths available. I would agree that if you want to process larger file(s), uploading it as part of the batch execution process would not be the best path forward.

More general information about container volumes in Kubernetes can be found here:
https://kubernetes.io/docs/concepts/storage/volumes/

Basically, the sas-programming-environment image that is used to run the compute/batch/connect servers contains SAS and not much else, so as part of the deployment process you make adjustments to add in network paths, data access drivers, and additional languages (E.g. python, R) as needed for your use case.

In the deployment assets, information and examples specifically on adding volumes to the CAS and compute pods can be found in:

$deploy/sas-bases/examples/sas-compute-server-configure/README.md
$deploy/sas-bases/examples/cas/configure/README.md

The relevant transformers being comptue-server-add-nfs-mount.yaml and cas-server-add-nfs-mount.yaml in those same paths, respectively.
--
Greg Wootton | Principal Systems Technical Support Engineer