It sounds like you are trying to “roll your own” json parsing but Panorama has built in functions for that. In fact, I didn’t roll my own either, these functions are built using Apple’s JSON parsing code that comes built into macOS. JSON parsing can be surprisingly complex, so it’s best to leave it to experts. If you open the Help wizard and search for json you’ll get a list of all the related functions.

Using the help file I see the various export and import functions and statements but what I am looking for is a way to directly edit a JSON formatted record in a similar way one would use settagdata to change the value of an xml tag. Is that possible?

No, that is not possible, at least not directly. You can use jsonimport( to convert the JSON into a data array or dictionary, then modify that, then use jsonexport( to convert back to JSON. If the original json text is a one level array or dictionary, that will be fairly straightforward. If the json text contains nested structures that will get more complicated, though still definitely possible.