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
  1. Target data-structure

  2. 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