Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The COZZI - Write Text to IFS file (IFSWRITER) command writes a user-specified string to an IFS file. If the IFS file does not exist, it is created. The data is converted by the system from the JOB CCSID to that of the target file. This occurs as the data is being written to the file. If the IFSWRITER command creates the file, it is created with a CCSID of 819.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
STMF | IFS Stream File name | Path name | Required, Positional 1 |
DATA | Data to write | Character value | Optional, Positional 2 |
RCDDLM | End of line symbol or *NONE | Character value, *CRLF, *CR, *LF, *LFCR, *NONE | Optional, Positional 3 |
CCSID | Stream File CCSID | 1-65533, 819, *ASCII, *UTF8, *EBCDIC, *JOB | Optional, Positional 4 |
Top |
Specifies the fully qualified IFS file to receive the data being written. If the file exists, the data is added to the end of the existing file. If the file does not exist, it is created with CCSID 819.
This is a required parameter.
Use the & symbol in the first character of the parameter to extend the parameter when the command is prompted.
Top |
Specifies the data to be written to the IFS file specified on the STMF parameter.
Use the & symbol in the first character of the parameter to extend the parameter when the command is prompted.
Top |
Specifies whether a CR or LF is written to the file following the data specified on the DATA parameter.
Top |
Top |
Example 1: Simple Write Text Example
IFSWRITER STMF('/HOME/USER/MYSTUFF.TXT') + DATA('This is some text written to the file.')
This command write a text string to the file MYSTUFF.TXT that is located in the IFS folder named '/home/user'.
Example 2: Write text followed by a Linefeed
IFSWRITER STMF('/home/app/log.info') + DATA('This is some text written to the file.') RCDDLM(*LF)
This command writes out text to the file named LOG.INFO that is located in the '/home/app' directory. The text is followed by a single linefeed character. Normaly for IFS text files, you often want a single linefeed, as illustrated in this example.
Top |
Top |