DS2 supports very large VARCHAR() variables. You could probably re-assemble the JSON from your data using a technique something like this:
data test;
length id 8 fake_json $ 32767;
do id=97 to 122;
fake_json=cats('{[',repeat(byte(id),32000),']}');
output;
end;
run;
proc ds2;
data _null_;
dcl varchar(1000000) json;
retain json;
method run();
json=json||strip(fake_json);
set test;
end;
method term();
put json=;
end;
enddata;
run;
quit;
From the log you can see that we've been able to build a text string much longer than 32767. Hope this helps 🙂
Mark