pjs.bitChange()



This API provides the ability to change the bits in a field.

Parameters
  1. Resulting field

  2. String of bit positions to change (between 0-7).

  3. Resulting bit (numeric 1 or 0)

Example
pjs.define("FieldA", { type: 'char', length: 1, initValue: String.fromEbcdicHex('4F') }); pjs.define("result", { type: 'char', length: 5 }); pjs.bitChange(FieldA, '046', 0); if (FieldA.rtrim() === String.fromEbcdicHex('45').rtrim()) { result = 'yes'; }



RPG Equivalent 

BITOFF, BITON