Hello,
I have been scouring now for a couple hours the posts and have yet to find anything that works. I am currently pushing to an API parameters which then gives me a JSON presigned URL and will then use that URL to upload a file. I am struggling because I am not the best at SAS and am struggling to know where my issues lie. I am able to get to the proc http post, and think the JSON file containing the presigned url from aws is in the resp variable because I am able to see it in the log. The format of the JSON file is as follows
{"presigned_url": "https:blahblah", "uuid": "blah", "file": "blah", "var4":"blah"}
I think that is my current issue as I cant go from this JSON into putting just the url into my next PROC HTTP request.
For reference in python I do all of that in one line
filename in temp;
data _null_;
file in;
put "value=key&"
"value2=key2&"
"value3=key3&"
run;
filename resp temp;
proc http
method="POST"
url="api.com"
ct="application/x-www-form-urlencoded"
in= in
out= resp
proxyhost="x"
proxyport=1;
run;
libname lib JSON fileref=resp;
filename rest temp;
filename input "fileToUpload.data";
proc http
method="PUT"
url=lib.contents.presigned_url
in= input
out=rest
run;
If you're more comfortable with Python then this blog should interest you: SAS or Python? Why not use both?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.