Chris' solution is interesting, but I think it's a bit easier to have PROC JSON create the whole thing, then strip out the crud around it and insert newlines automatically, so long as the total string length is 32767 or less per line (adjust the length str $1024 to the appropriate length). If it's over that, you will have issues in either solution and may be better off generating a single file from SAS and then using another program (python, for example) to write a simple script to remove the [{ }] and commas.
Edit: I'm making some hopefully minor changes to deal with files > 32767 in length.
filename out "c:\class.json" encoding="utf-8" termstr=cr; *wherever you put this;
filename jsonbuf temp; *temporary location for initial json output;
proc json out=jsonbuf nosastags; *output the whole datafile;
export sashelp.class;
run;
data _null_;
infile jsonbuf dsd dlmstr='},{' eof=_end; *each record is delimited by this;
file out;
length str $1024; *make sure this is long enough for your records;
do _n_ = 1 by 1; *just iterating, eof will exit the loop when done;
input str $ @; *read that record in;
if str =: '[{' then str = substr(str ,3); *first record, cut off the starting bit;
if reverse(trim(str )) =: ']}' then str = substr(str ,1,length(str)-2); *last record, cut off the ending bit;
str = cats('{',str,'}'); *put back in the { } outside braces we lost using DLMSTR;
putlog str; *just for debugging;
put str $; *write it out to final file;
end;
_end: *where we go when end of file is reached;
stop;
run;
... View more