>> (FILEAPPend)
v1.1
v2.1

Purpose, Argument, Streams, Usage, Examples, Related

Syntax

                                         (2)┌─WRITE──┐ 
                    ┌─NOCLOse─┐             ├─R/W────┤
>>──┬─>>─────────┬──┼─────────┼──┬───────┬──┼────────┼──┬──────────┬─────────────────>< 
    └─FILEAPPend─┘  └─CLOse───┘  └─RECno─┘  ├─RDONLY─┤  └─filename─┘
                                            └─R/O────┘    (1)
Notes: (1) The filename operand is only allowed if the stage does not have a secondary input stream connected. (2) Unless the WRITE keyword is specified; a file that is write-protected (RDONLY) remains write-protected after it has been processed. (3) FILEAPPEND cannot be specified as the first stage in a pipeline.
Purpose

Use the FILEAPPEND stage to create a disk file or append to the contents of an existing disk file.

FILEAPPEND reads records from its primary input stream and writes them to the specified file and to its primary output stream, if it is connected. FILEAPPEND prepends a Line-Feed character to each output record that it writes to the specified file, primary output stream records are written unchanged. If the file already exists, FILEAPPEND appends the records.

If you do not specify a fully qualified path and file name, the FILEAPPEND stage will search for the input file in the current working directory, otherwise, it will create a new file in the current working directory.

Argument
Streams

The following streams and files are used by the FILEAPPEND stage:

  1. Input streams

  2. Output file

  3. Output streams

Usage
  1. FILEAPPEND does not delay the records.

  2. If FILEAPPOUT discovers that its primary input stream is not connected, the FILEAPPEND stage ends.

  3. FILEAPPEND determines if an output file exists at the moment the file is opened for writing. FILEAPPEND opens an output file for writing when there is an output record to write. FILEAPPEND does not create empty files.

  4. FILEAPPEND appends a Line-Feed character to all but the last record that it writes to the specified output file.

  5. FILEAPPEND verifies that its secondary output stream is not connected and then begins execution.
Examples
  1. The following pipeline reads records from the console and appends them to the file: myfile.txt. The pipeline ends when a null record is entered.

    'pipe console | >> myfile.txt 
    
Related

CONSOLE, > (FILEIN), > (FILEOUT), IN, OUT

History

Version
Date
Action
Description
Pipelines
1.2
??.??.2025
changed
Application-wide rewrite
2.1
1.1
09.10.2007
added
Without the filename operand, each time FILEAPPEND reads an input record; it extracts the first word or quote (“) delimited phrase and uses this as the name of the target output file. The remainder of the input record data is used as the record which is written to the specified output file and to the primary output stream, if it is connected. If you do not specify a fully qualified path, FILEAPPEND creates or appends to the specified output file in the current working directory.
1.2
1.0
06.09.2007
created
First version.
1.0