Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The assignCorresponding API will assign elements from the second DS into the first DS - but only for the subfields that exist in both.

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

  • No labels