COZZI - Write Text to IFS file (IFSWRITER)

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

Parameters

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

IFS Stream File name (STMF)

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.

path-name
Specify the path and file to be written to.
Top

Data to write (DATA)

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.

character-value
Specify any text data to be written to the file. The data is converted to the CCSID of the file by the system as it is being written to the file.
Top

Add CR and/or LF to data (RCDDLM)

Specifies whether a CR or LF is written to the file following the data specified on the DATA parameter.

*NONE
No addition record delimitor is written to the file. Only the data in the DATA parameter is written.
*CRLF
A carriage return/linefeed (X'0D25') sequence is written to the file following the data specified on the DATA parameter.
*LF
A linefeed (X'25') sequence is written to the file following the data specified on the DATA parameter.
*CR
A carriage (X'0D') sequence is written to the file following the data specified on the DATA parameter.
*LFCR
A linefeed/carriage return (X'250D') sequence is written to the file following the data specified on the DATA parameter.
character-value
Specify up to 10 characters or hexadecimal values that are written to the file following the data specified on the DATA parameter.
Top
Top

Examples for IFSWRITER

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

Error messages

Unknown
Top