Page History
...
Variables substitution may be used in the text strings, permitting you to easily mix text with Processing Sequence variables values – or to create a line of comma-separated values to write.
You can refer to the EXAMPLE_WRITEFILE01 Processing Sequence for an example of using the WRITE_FILE activity.
INPUT Parameters:
WRITEFILEPATH: Required
This parameter specifies the path and file name of the file to be written.
If you write to the file more than once in the course of a Processing Sequence run, you must ensure that you pass the path and file name of the file in exactly the same form to ensure that an open file handle for the file is re-used for continued writes to the file.
WRITETEXT: Optional
When the value of the WRITEACTION parameter is *WRITE, this parameter specifies the text to be written to the file.
...
If two ampersands (&&) or two asterisks (**) appear together in the string, they are reduced to a single ampersand or asterisk and not considered for substitution.
WRITEACTION: Optional
This parameter specifies the type of WRITE_FILE action to perform.
...
A third value, *CLOSE, allows you to control when the file is closed. You may need to use this after writing the file contents, if you wish to use the file in other Activities or Transformation Maps in the same Processing Sequence run. When the containing Processing Sequence ends, any remaining opened files are automatically closed, so you only need to explicitly close a file if you need to use it for another purpose. The values of the WRITETEXT, WRITEOPTION and WRITECCSID parameters are not used when you specify *CLOSE for the WRITEACTION parameter.
WRITEOPTION: Optional
This parameter specifies the option to be used when either *WRITE or *OPEN is specified for the WRITEACTION parameter.
...
*NOLINETERMINATOR (or blank): no line terminator is written.
...
| Note | ||||
|---|---|---|---|---|
| ||||
On Windows server platforms, all the line terminator options (*CRLF, *LFCR, *CR, *LF, *NL) result in a carriage return/line feed pair. The distinct line terminator options are not supported. You may still use *NOLINETERMINATOR to avoid any line terminator being written. |
For *OPEN, one of the following values controls how the file is opened:
...
*OVERWRITE: the file will be opened for write. If the file does not exist it will be created. If the files does exist the existing contents will be overwritten.
WRITECCSID: Optional
This parameter applies only on IBM i servers. It allows you to specify the IBM i CCSID with which the output text file is created.
...
NOTE: the assumed or explicit CCSID is applied only when the file is opened in the course of the WRITE_FILE activity and the specified output file does NOT already exist. If the specified output file already exists and is being replaced or appended to by this activity, then its CCSID will not be changed.
OUTPUT Parameters:
There are no output parameters.