The behaviour of the JES API appears to have changed in the last year or so, and we need some help getting our (previously functional) code to work!
We are running a Job (using POST /jobExecution/jobs - https://developer.sas.com/rest-apis/jobExecution/createJob ) that returns a JSON file generated using the following code (as described here )
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json";
data _null_;
file _webout;
put '{"name" : "value")';
run;
The exact API request looks like this:
With the following payload:
We then poll for results using: /jobExecution/jobs/db8810ec-7282-4093-a0f9-41f693ebf359/state?_action=wait&wait=300
And finally fetch the results using: /jobExecution/jobs/db8810ec-7282-4093-a0f9-41f693ebf359
With the following response:
We have tried tweaking the arguments, to no avail.
The _webout fileref is definitely created. We have also tried using the RESULTFILE option.
How to get the _webout result location returned to the JES API triggered Job?
Unfortunately not.
I went and created a SASjs project to illustrate the issue. You can deploy it to Viya in 3 lines of code:
%let apploc=/Public/jes_demo; /* your preferred SAS Drive location */ filename demo url "https://raw.githubusercontent.com/allanbowe/jes_issue/refs/heads/main/viya.sas"; %inc demo;
In the last line of the log there is a link to a Job - this contains the PROC HTTP calls that illustrate the problem (preceded by some supporting macro definitions). Copy that URL into a browser and add "&_DEBUG=2477" before submitting.
This will show the log and the reponses from the HTTP calls. You can edit that job directly, eg to play around with the request body. Just save the job definition and refresh the browser for the results.
Source code for the project is here: https://github.com/allanbowe/jes_issue
Finally figured it out - was triggered by this usage note: https://documentation.sas.com/doc/zh-cn/sasadmincdc/v_021/caljobs/n0t21mf756sv0en1kd176kky8upt.htm
Turns out that the behaviour changed in February this year, and now _omitSessionResults is both mandatory (if you want the results) and - CASE SENSITIVE
This smells like a bug and it's currently in SAS track, case number CS0254721
The fix to the SASjs adapter is here: https://github.com/sasjs/adapter/pull/845/files
And the fix to SASjs Core is here: https://github.com/sasjs/core/pull/397/files
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 lock in 2025 pricing—just $495!