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 XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.