Here is some JSON. I omitted "number" in several entries. [
{
"type": "Full",
"info" : [
{ "name" : "Eric" , "age" : 21, "phone" : [
{ "type" : "cell" },
{ "type" : "home", "number" : "542" }
]
},
{ "name" : "John", "age" : 22, "phone" : [
{ "type" : "cell", "number" : "456" },
{ "type" : "home"},
{ "type" : "home"}
]
}
]
},
{
"type": "Part",
"info" : [
{ "name" : "Bjorn" , "age" : 27, "phone" : [
{ "type" : "cell", "number" : "721" },
{ "type" : "burner"}
]
}
]
}
] Here is a map. I am reading "number" 3 times: As character As numeric with an informat As numeric without an informat {
"DATASETS": [
{
"DSNAME": "all",
"TABLEPATH": "/root/info/phone",
"VARIABLES": [
{
"NAME": "Type",
"TYPE": "CHARACTER",
"PATH": "/root/info/phone/type"
},
{
"NAME": "number1",
"TYPE": "CHARACTER",
"PATH": "/root/info/phone/number"
},
{
"NAME": "number2",
"TYPE": "NUMERIC",
"PATH": "/root/info/phone/number",
"INFORMAT": ["BEST", 3, 0]
},
{
"NAME": "number3",
"TYPE": "NUMERIC",
"PATH": "/root/info/phone/number"
}
]
}
]
} Here are the results. filename jsondata "example.json";
filename example "example.map";
libname example JSON fileref=jsondata map=example;
data work.test;
set example.all;
run; When using an informat, the results seem to be getting retained instead of appearing as missing. How do I fix this?
... View more