returning packed values via json
Posted: Mon Apr 29, 2019 1:38 pm
I am calling a program and want to return the results as a json object. However, those darned packed values are not playing nice. everything seems to be working, except translating the data structure to json with packed values.
if i evaluate the field value individually using the following:
then the value is correct. but it blows chucks on the packed values. all other values are correct (no errors, just not readable data). I was not able to find documentation to convert the packed values.
if i evaluate the field value individually using the following:
Code: Select all
console.log(logmessage + myDS[1].field1);
Code: Select all
pjs.define(
"myDS", {type: "data structure", dim: 15, qualified: true, elements: {
"field1": {type: "packed", length: 3, decimals:0, packeven: true},
"field2": {type: "packed", length: 5, decimals:0, packeven: false},
"field3": {type: "char", length: 4},
"field4": {type: "decimal", length: 3, decimals:0 }
}});
pjs.call("mylib/myprogram", pjs.refParm("myDS"));
response.json({records: pjs.getDSValue(myDS)});