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

Version 1 Next »

This API writes to an IBM i IFS file and performs optional text conversion. If the file already exists, it is deleted and re-created.

Parameters

  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) – Specifies the CCSID attribute of the file. 
  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.

Exception Handling

An Error instance will be thrown if there are any problems writing the file.

Examples

Write JavaScript String to Text File in EBCDIC 37
var buffer = Buffer.from("Hello, world.", "utf8");
pjs.writeIFSFile("/home/rfite/ebcdic.txt", buffer, 37, 1208);
  • No labels