- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
First question: Is it possible to modify job definition with REST API? Can you show an example of code to do it?
I was able to do it with a reports and METHOD="PUT":
PROC HTTP METHOD="PUT" URL="&BASE_URI./&dstReportURI./content" OAUTH_BEARER=SAS_SERVICES
IN=&contentFile. HEADEROUT=hdrout ;
HEADERS "Accept"="*/*"
"Content-Type"="application/vnd.sas.report.content+json"
"IF-MATCH"=""&ETAG""
"IF-UNMODIFIED-SINCE"=&MODDATE.;
RUN;
Second question: How can I extract ETAG from the existing job? I was able to extract headers from the report, but a similar code doesn't return ETAG for jobs.
This code returns header info with ETAG for reports:
PROC HTTP METHOD="HEAD" URL="&BASE_URI&report_uri."
OUT=rep_id HEADEROUT=hdrout OAUTH_BEARER=SAS_SERVICES;
HEADERS "Accept"="application/vnd.sas.report+json"
"Content-Type"="application/vnd.sas.report+json";
RUN;
This code returns a header content, but with no ETAG for the job:
PROC HTTP METHOD="HEAD" URL="&BASE_URI/jobDefinitions/definitions/&job_uri
OUT=rep_id HEADEROUT=hdrout OAUTH_BEARER=SAS_SERVICES;
HEADERS "Accept"="application/vnd.sas.job.definition+json"
"Content-Type"="application/vnd.sas.job.definition+json";
RUN;
At that moment I see 2 milestones:
1. How to extract ETAG from existing job?
2. How to update existing report with new code/parameter?
Thanks in advance,
Ivan
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ivan (@idziemianczyk ),
1. How to extract ETAG from existing job?
I'm not sure why your response does not contain an ETag in the header? I passed an API call for a job definition and I see the ETag header in the response:
2. How to update existing report with new code/parameter?
Take a look at the SAS Viya API documentation. There is a good example of a create job and an update job API call. The example uses similar parameters and code, so you should be able to see the difference in the update call.
Please let me know if I can assist further.
Thanks,
Joe
Join us for SAS Community Trivia
Wednesday, November 19, 2025 at 10 am ET.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ivan (@idziemianczyk ),
1. How to extract ETAG from existing job?
I'm not sure why your response does not contain an ETag in the header? I passed an API call for a job definition and I see the ETag header in the response:
2. How to update existing report with new code/parameter?
Take a look at the SAS Viya API documentation. There is a good example of a create job and an update job API call. The example uses similar parameters and code, so you should be able to see the difference in the update call.
Please let me know if I can assist further.
Thanks,
Joe
Join us for SAS Community Trivia
Wednesday, November 19, 2025 at 10 am ET.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I missed etag because I read the file in SAS code (hasn't checked the file itself). There was no ETAG.
My code for reading a header file was wrong, the line with ETAG wasn't visible. Anyway, the problem solved. Thanks a lot.