BookmarkSubscribeRSS Feed
Pyrite | Level 9

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?

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.
Greg Wootton | Principal Systems Technical Support Engineer
Pyrite | Level 9

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. 

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 XXXVI, Data Simulation
Wednesday, December 13, 2023, 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 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

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