I have a problem with my SAS version, that not contains the JSON packages to parse a JSON file, so I built the code below in SAS traditional programming as a workaround. The code will be execute by SAS ESP. filename data '/sasdata/ma/mailing/ric4.json';
data datatest (drop = linha pos);
infile data lrecl = 32000 truncover scanover dsd firstobs=2;
Length linha $255.;
Input Linha;
campo = trim(left(tranwrd(scan(linha,1,': '),'"','')));
/*
verificar se e uma informacao de data
*/
pos=index(linha,'_date');
if pos = 0 then do;
conteudo = trim(left(tranwrd(tranwrd(scan(linha,-1,': '),'"',''),',','')));
end;
else do;
conteudo = trim(left(tranwrd(tranwrd(scan(linha,-2,'_date"'),'"',''),',','')));
end;
if trim(left(campo)) not in ('[','{',']');
grava = 0;
grava =index(campo,'}');
run;
... View more