You don't need to use PROC JSON to write such a simple JSON file. Much easier to just write the JSON directly instead of trying to write the PROC JSON code. You can just use a FORMAT to have your boolean values displayed as true/false.
proc format ;
value tf ._ - .Z,0 = 'false' other='true' ;
run;
data example;
infile cards dlm='|' dsd truncover ;
input charData :$30. numData booleanData ;
format booleanData tf. ;
cards;
Testing some Boolean output|17|0
Testing more Boolean output|24|1
;
filename json temp;
data _null_;
set example end=eof;
file json ;
if _n_=1 then put '['/' ' @; else put ',' @;
put '{' @;
put '"charData": ' chardata :$quote. ;
put ' ,"numData": ' numData ;
put ' ,"booleanData": ' booleanData ;
put ' }';
if eof then put ']';
run;
Plus you end up with much prettier formatting of the JSON file where continuation characters are at the beginning of the lines where it is easier for humans scanning the file to see them.
[
{"charData": "Testing some Boolean output"
,"numData": 17
,"booleanData": false
}
,{"charData": "Testing more Boolean output"
,"numData": 24
,"booleanData": true
}
]
... View more