Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Path (String) - Path to the IFS file to write.
  2. Data (Buffer) - A Buffer instancing containing the data to write to the file.
  3. File CCSID (Number/optional) – Specifies the CCSID attribute of the file.  If omitted or set to zero, the IBM i job CCSID will be used.
  4. Data CCSID (Number/optional) - Specifies the CCSID of the data to write to the file. The data will be converted from this CCSID to the file CCSID. If this parameter is omitted or set to zero, the data will be converted from the CCSID of the IBM i job to the file CCSID. If set to 65535 no conversion will be done.

...

Code Block
languagejavascript
titleWrite EBCDIC Field Data to UTF8 Text File
  pjs.define("myfield", { type: "char", length: 13, initValue: "Hello, world." });
  pjs.writeIFSFile("/home/rfite/utf8.txt", pjs.getBuffer(myfield), 1208, 37);


Code Block
languagejavascript
titleWrite UTF-8 Data to File Without Conversion
  var buffer = Buffer.from("Hello, world.", "utf8");
  pjs.writeIFSFile("/home/rfite/utf8.txt", buffer, 1208, 65535);