pjs.putDataArea()



This API retrieves writes data to an IBM i data area. Data is written starting at position 1. 

Parameters
  1. name - A string containing the data area name, in LIBRARY/OBJECT_NAME notation. If the library is omitted the job's library list will be used to resolve the data area. The special values "*LDA", "*GDA", and "*PDA" can also be used.

  2. data - A Buffer instance containing the data to write to the data area, or a Number value to write to the data area.

  3. unlock (optional) - If Boolean true is passed the data area will be unlocked, if necessary, after the data is written.

Return Value

None.

Exception Handling

If there is a problem retrieving the data, an Error will be thrown with the following properties:

  • message - The IBM i message text.

  • error - The message id.

  • help - The message help text.

Examples



Write decimal data to the local data area
try {   var buffer = new Buffer([0xF1, 0xF2, 0xF3, 0xF4, 0xF5]); // 12345 pjs.putDataArea("*LDA", buffer); } catch (error) { // Problem! Data not written. }



RPG Equivalent

OUT



Requirements

This API requires the Profound.js Connector module.