Hello everybody, fairly new in the world of SAS, a curious person,say, learning in his own time. I am trying to riddle out how to make a successful POST/GET request to REST API using %macro and JSON as the primary payload and then set up a table that tracks a history of past requests and responses. Set this task to myself as it's one of the more common things people aim to do in other languages. Working with APIs. While, it takes me about 10 minutes to write such logic in JS or Python without any headaches, though I cannot string up a working logic in SAS using %macro (a term function could also be used as a synonym I guess?). A non-macro approach clicked using datalines and a hard-coded value as a prompt. I am now well aware that datalines will not budge when using macro logic so I went with put, but still not a single budge. Here's the code that I have managed to jot down so far. The API is crudcrud.com allowing up to 100 free requests. %macro api_post_request(prompt=);
%let api_url=url;
filename json_in temp;
data _null_;
file in;
put "{
""username"":""&prompt""
}"
;
run;
filename resp temp;
proc http method="POST"
url="&api_url
ct="application/json"
in=json_in
out=resp;
headers
"Content-Type"="application/json";
run;
%mend;
%api_post_request(prompt=Player1); Fierce thanks!
... View more
A new update is available for Base SAS , version 15.3 : Hot Fix: L9L016 - Published 01MAY2024 , Download link for L9L016 Component name: SAS/STAT Related SAS release: 9.4 Issues addressed in L9L016 SAS Note 70709 A memory corruption vulnerability exists in Base SAS® and SAS/STAT® SAS Note 70709 A memory corruption vulnerability exists in Base SAS® and SAS/STAT® This list of notes might be incomplete. For a complete list of issues addressed by this hot fix, visit the hot fix page for L9L016 Note: A comprehensive list of all SAS hot fixes is available from support.sas.com. You can use the SAS Hot Fix Analysis, Download, and Deployment (SASHFADD) tool to manage your SAS hot fixes.
... View more
I have recently started to make some reports about the reports within our Viya 4 environment using the documentation I could find and have basically succeeded to retrieve the information we need. However, what I have not been able to find is whether there is a way to limit the items returned when doing an API call.
For example within the PI Web API it is possible to use the "selectedFields" parameter. I have not been able to find a similar parameter within the documentation for the SAS Viya REST API, therefor my question: Is such a parameter available?
For example to use an URL like: &BASE_URI/folders/folders/&uri/members?start=0&limit=10&selectedFields=items.name,items.id Which would give me only the name and id field from the items "table"
... View more