Hi experts:
I have Viya 3.5. I need a way to orchestrate these tasks:
My approach was to consume the SAS Rest API (https://developer.sas.com/guides/rest.html), though I'm not sure if the right approach because I have to format "proc http response" from SAS Studio, for example:
I want to ask 2 questions:
I am open to all suggestions. Thanks in advance.
Personally, I wouldn't do this in Studio, I'd write a shell script instead
```
# first, set up the authentication using sasjs auth with client/secret pair
cd myrepo # move into project
git pull # grab source code
sasjs cbd # compile, build & deploy my job(s)
sasjs job execute /path/to/my/job -l /local/path/to/my.log
```
If you must use SAS code, in Studio (Viya) you don't actually need an access token as you can use the oauthbearer=sas_services proc http option.
In this case you can use the git_clone and git_pull SAS functions to clone the repo.
Then, this macro to create the job(s): https://core.sasjs.io/mv__createjob_8sas.html
And this macro to run them: https://core.sasjs.io/mv__jobflow_8sas.html
We don't work much with Model Manager (our main focus is cross-platform SAS apps and related modernisations) but available to support if needed.
Hi @a20121248
Talk to the folks at SASJs.io
They have a macro for that 😉 (getting App Token, that is)
In terms Orchestration/Automation within SAS Studio, it all depends on which version of Viya/SAS Studio you are using!
There are various versions of SAS Studio and they vary in their features and functionalities.
https://support.sas.com/software/products/sas-studio/faq/SASStudio_releases.htm
https://support.sas.com/software/products/sas-studio/faq/whatsnew.htm
Hope this helps
Personally, I wouldn't do this in Studio, I'd write a shell script instead
```
# first, set up the authentication using sasjs auth with client/secret pair
cd myrepo # move into project
git pull # grab source code
sasjs cbd # compile, build & deploy my job(s)
sasjs job execute /path/to/my/job -l /local/path/to/my.log
```
If you must use SAS code, in Studio (Viya) you don't actually need an access token as you can use the oauthbearer=sas_services proc http option.
In this case you can use the git_clone and git_pull SAS functions to clone the repo.
Then, this macro to create the job(s): https://core.sasjs.io/mv__createjob_8sas.html
And this macro to run them: https://core.sasjs.io/mv__jobflow_8sas.html
We don't work much with Model Manager (our main focus is cross-platform SAS apps and related modernisations) but available to support if needed.
Hi @a20121248,
You can also take a look at some of @Mike_Drutar's Community articles on Job Execution. For example, Executing a JES Job Using JavaScript. He has several others posted and they're super easy to follow.
Join us for SAS Community Trivia
SAS Bowl XLVI, Causal Analysis
Wednesday, December 18, 2024, at 10 a.m. ET | #SASBowl
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.