If you are using SAS 9.4 maintenance 4 or better, you can use the JSON LIBNAME engine to read in your line of JSON. Here is the code I threw together that produces your results. Note that MAP='MY.MAP' in the LIBNAME statement is just a file name for the JSON LIBNAME engine to place the generated JSON map file.
libname x json 'sasuser\jsonInfile1.txt' map='my.map' automap=reuse;
data work.xaxis(keep=value rename=(value=xaxis))
work.yaxis(keep=value rename=(value=yaxis))
work.col (keep=value rename=(value=col))
work.row (keep=value rename=(value=row))
work.val (keep=value rename=(value=val));
set x.alldata;
if (V = 1)
then do;
if (p2 EQ "")
then do;
select (p1);
when ("yaxis") output work.yaxis;
when ("xaxis") output work.xaxis;
otherwise put "Unexpected :" p1;
end;
end;
else do;
select (substr(p2,1,3));
when ("col") output work.col;
when ("val") output work.val;
when ("row") output work.row;
otherwise put "Unexpected :" p2;
end;
end;
end;
run;
data work.merged;
merge work.xaxis work.yaxis work.col work.row work.val;
run;
proc print data=work.merged; run;
... View more