pjs.assignCorresponding()
This API assigns subfield values of one data structure to subfields of another data structure, but only for subfields that exist under the same name in both data structures.
Parameters
Target data-structure
Host data-structure
Example
pjs.define("result", { type: 'packed decimal', length: 10, decimals: 0 });
pjs.define("Ds1", { type: 'data structure', qualified: true, elements: {
"num": { type: 'integer', length: 3, decimals: 0, initValue: 123 },
"extra": { type: 'date' },
"char": { type: 'char', length: 20 }
}});
pjs.define("Ds2", { type: 'data structure', qualified: true, elements: {
"char": { type: 'char', length: 20 },
"diff": { type: 'char', length: 5 },
"num": { type: 'packed decimal', length: 3, decimals: 0 }
}});
pjs.assignCorresponding(Ds2, Ds1);
result = Ds2.num;
RPG Equivalent
EVAL-CORR
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!