Hi,
I have the following code:
options NOQUOTELENMAX; filename usage "/folders/myfolders/sasuser.v94/usage.json"; %let AccessKey = reallylongstring; proc http url="https://a.url" method="GET" out=usage; headers "Authorization"="Bearer &AccessKey."; run; libname usage json "/folders/myfolders/sasuser.v94/usage.json"; data usage; set usage.data; run; proc print data=usage noobs; run;
is it possible from the proc http to load the json data into the dataset instead of populating a file then loading the dataset from the file?
Thanks
Hi @Dwayne-Dibbley, it's very doable. Check out the blog post from @ChrisHemedinger:
https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/
(I like the "Who is in space right now" example).
Hi @Dwayne-Dibbley, it's very doable. Check out the blog post from @ChrisHemedinger:
https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/
(I like the "Who is in space right now" example).
Actually @Dwayne-Dibbley, assuming that the code you shared is working for you, that's exactly how you do it. The JSON response comes back as a file, and then you use the JSON LIBNAME engine to read it. It might (logically) contain several data sets that relate to each other, so this additional step is needed for SAS to interpret the data as you need 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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.