BookmarkSubscribeRSS Feed
AllanBowe
Barite | Level 11

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:

 

AllanBowe_0-1747731916447.png

 

 

With the following payload:

 

AllanBowe_1-1747731916449.png

 

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:

 

AllanBowe_2-1747731916451.png

 

We have tried tweaking the arguments, to no avail.

 

The _webout fileref is definitely created.  We have also tried using the RESULTFILE option.

 

AllanBowe_3-1747733439403.png

 

How to get the _webout result location returned to the JES API triggered Job?

 

/Allan
MacroCore library for app developers
Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
3 REPLIES 3
gwootton
SAS Super FREQ
Does changing the argument for your jobRequest "_OMITSESSIONRESULTS" to "false" change the behavior back to providing _webout?
--
Greg Wootton | Principal Systems Technical Support Engineer
AllanBowe
Barite | Level 11

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

/Allan
MacroCore library for app developers
Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
AllanBowe
Barite | Level 11

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

 

/Allan
MacroCore library for app developers
Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Discussion stats
  • 3 replies
  • 944 views
  • 4 likes
  • 2 in conversation