I have a question that I asked SAS directly and they pointed me to this message board. Our team is migrating into SAS Viya and previously ran jobs on a grid service where the status of jobs could be pulled down with a macro and printed. I'm trying to replicate this in the Viya environment. I am using RSUBMIT blocks with SIGNON statements to batch submit programs and I can see these jobs within the workload orchestrator while it they are running:
I was previously pointed to some code that works with proc http to pull information with an API I believe (I am not familiar with this type of extraction of information). https://communities.sas.com/t5/Administration-and-Deployment/How-to-retrieve-status-of-scheduled-job... I tried to modify it but it does not pull information about individual RSUBMIT sessions, only the overarching program running the RSUBMITS:
%let baseurl=;/**Removed the URL due to company protocol**/
%macro getjobs();
/* Initialize files */
filename headout temp;
filename resp temp;
/* Call the jobExecution REST API using whatever filter you want to limit the results */
proc http oauth_bearer=sas_services url="&baseurl/jobExecution/jobs?start=0%nrstr(&limit)=20%nrstr(&filter)=ge(creationTimeStamp,%272025-12-18T05:00:00.000Z%27)" out=resp headerout=headout HEADEROUT_OVERWRITE;
headers "Accept"="application/json";
run;
/* Read in the response using the JSON libname engine. */
libname resp json fileref=resp;
/* Define a data set with the information we want. */
proc sql;
create table jobs
(name char(255),stat char(50),createdBy char(50),creationTimeStamp char(25),expirationTimeStamp char(25), elapsedTime num);
insert into work.jobs
select a.name,b.state,b.createdBy,b.creationTimeStamp,b.expirationTimeStamp,b.elapsedTime
from resp.items_jobrequest as a,resp.items as b where a.ordinal_items = b.ordinal_items;
quit;
/* Check for a next link (meaning there are more results not in the initial response) */
%local next;
data _null_;
set resp.links;
where rel="next";
call execute('filename r'||strip(put(_n_,12.0))||' temp;');
call execute('%nrstr(proc http oauth_bearer=sas_services url="%%nrstr('||"&baseurl"||strip(href)||')" out=r'||strip(put(_n_,12.0))||' headerout=headout HEADEROUT_OVERWRITE;)');
call execute(' headers "Accept"="application/json";');
call execute('run;');
call execute('libname r'||strip(put(_n_,12.0))||' json fileref=r'||strip(put(_n_,12.0))||';');
run;
%mend getjobs;
%getjobs();
Is there something similar to this that anyone has used to access the workload orchestrator list?
I don’t think SAS should have referred you to the SAS communities and let their customers answer your question.
SAS Technical Support should be able to answer whether it is possible or if an API exists that can provide specific information about rsubmit sessions.
You could try using the browser’s developer tools to see if you can identify this API. It’s also worth checking the REST API documentation yourself.
However, it’s possible that SAS has not made this API public and therefore does not provide support for it.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.