BookmarkSubscribeRSS Feed
DanielKaiser
Pyrite | Level 9

Hi,
I am looking for a way to execute a viya job from outside, to include it in existing processed with dependencies outside the sas environment. 

I am looking for something like a shellscript, that gets the Job-URI or the path as a command and then executes this. 
The script also has to return the correnct returncodes - 8 if the job ended with error, 4 if the job ended with warnings and 0 if the job ended successful.

Any ideas?

3 REPLIES 3
gwootton
SAS Super FREQ
I think you'd be able to do the things you need through the Viya REST APIs, so it would just be a matter of writing code to authenticate, submit a job, check its status periodically and then exit when the job completes with the exit codes you mentioned.

https://developer.sas.com/apis/rest/Compute/#job-execution
--
Greg Wootton | Principal Systems Technical Support Engineer
DanielKaiser
Pyrite | Level 9

Hi,
yeah, we were able to execute a job via sas-admin job webapp execute. But the thing is the authentication, without writing down username or password in any files. 

joeFurbee
Community Manager

Hi @DanielKaiser,

You have multiple authentication options with SAS Viya. You can register a client (app) and generate an access token. With this token, you can securely make the API calls @gwootton mentioned. Refer to Authentication to SAS Viya: a couple of approaches for detailed steps. There are also multiple resources here within the Community dealing with Job Execution and authentication. 


Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1042 views
  • 1 like
  • 3 in conversation