Hi Tom, I checked out that other thread, at https://communities.sas.com/t5/SAS-Programming/SAS-EG-how-to-read-in-JSON-file/m-p/710217, and after using your code (with a minor change to the IF EOF code) to convert his JSONL code to JSON, I was able to use the same code as above to do a simple merge of all 3 data sets and get the desired result. I know you are correct that each file is different, but I aspire to understand enough about the nuances of JSON files to have a feel for what types of files will resolve directly. filename jsonl "/my/home/m1xxx00/json/example10/ten.jsonl";
filename json "/my/home//m1xxx00/json/example10/ten.json";
data _null_;
infile jsonl end=eof;
file json;
if _n_=1 then put '[' @ ;
else put ',' @ ;
input;
put _infile_;
if eof then do;
put ']';
stop; /* otherwise I got an extra , at the end */
end;
run;
libname in10 json '/my/home/m1xxx00/json/example10/ten.json'
map='user10.map' automap=create ordinalcount=all;
libname xxx '/my/home/m1xxx00/json/example10';
proc copy in=in10 out=xxx;
run;
/* Data sets ALLDATA, QUANTITY, ROOT, and VALUE in the library. */
proc datasets lib=xxx;
run;quit;
/* Simple merge of all data sets */
data simpledata10;
merge xxx.root xxx.quantity xxx.value;
by ordinal_root;
/* drop ordinal_:; */ /* Comment out to test */
run;
proc print data=simpledata10;
run;
... View more