I would like to use the SAS libname JSON engine instead of PROC GROOVY to import the JSON file that I get from the Twitter API. I am running SAS 9.4M4 on OpenSuse LEAP 42.3.
I followed Falco Schulz's description of how to access the Twitter API and Everthing worked fine. Until the moment when I wanted to import the JSON file into SAS. Thus, the last working line of code:
proc http method="get"
out=res headerin=hdrin
url="https://api.twitter.com/1.1/search/tweets.json?q=&TWEET_QUERY.%nrstr(&)count=1"
ct="application/x-www-form-urlencoded;charset=UTF-8";
run;
which gives the json file in the file referenced by the file name "res".
Falco Schulz uses PROC GROOVY. SAS 9.4M4, however, has this mysterious JNON libname mechanism that makes life easier. And it works for simple JSON files. But not for Twitter data. So the JSON data from Twitter is loaded using
libname test JSON filref=res;
gives the following error:
JSON 751: .
, - , :
filename res TEMP encoding="utf-8";
...
filename res TEMP encoding="utf-8" lrecl=1000000;
... ...
- ? ? JSON LIBNAME ?