BookmarkSubscribeRSS Feed
AllanBowe
Barite | Level 11

Would you like to run SAS code on your hackathon Viya 4 instance from terminal, perhaps in VS Code?

 

Well - you can!  Just follow these steps:

 

1.  Install the SASjs CLI - https://cli.sasjs.io/installation.  (alternatively, use this gitpod instance:  https://gitpod.io/#github.com/sasjs/template_jobs)

2.  Run `sasjs auth` and provide your Viya 4 server url (without trailing slash), client id of `hack_client` and client secret of `hack_secret`.

3.  Create and save your desired SAS program
4.  Run `sasjs run /path/to/your/program.sas`

 

For more info on sasjs run, see docs:  https://cli.sasjs.io/run

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
3 REPLIES 3
pmbrown
Quartz | Level 8

i guess this wouldn't work with free sas viya?: https://statisticalhorizons.com/free-sas/ ie could i provide the url created when i launch sas after signing in here?: https://welcome.oda.sas.com/ thanks

AllanBowe
Barite | Level 11

Hi @pmbrown ,

 

The first link you shared is about UE, which has gone the way of the dodo

The second link (ODA) is only SAS Studio, so it does not provide access to the Viya APIs which are necessary for ANY client to connect (not just SASjs)

The only SASjs product you could use with ODA would be the core library: https://core.sasjs.io

If you have Base SAS (desktop) or SAS EBI at work though, you can still use SASjs, including this feature (running code from the terminal).  For Base SAS it makes use of SASjs Server (https://server.sasjs.io) and for EBI it uses a Stored Process to inject code.

/Allan

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
pmbrown
Quartz | Level 8

excellent, i do have sas base on the work computer so i will try it there, thanks. My 1st choice was the personal computer because it's linux and everything seems easier, but i have no sas on it

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Get Ready to Hack! 2024 SAS Hackathon

If hackin’ is your jam, we’re droppin’ it like it’s PROC with our groovy tune!

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1234 views
  • 7 likes
  • 2 in conversation