Purpose | Argument | Streams | Usage | Examples | Related
(2)┌─WRITE──┐
┌─NOCLOse─┐ ├─R/W────┤
>>──┬─FILEAPPend─┬──┼─────────┼──┬───────┬──┼────────┼──┬──────────┬─────────────────><
└─(>>)───────┘ └─CLOse───┘ └─RECno─┘ ├─RDONLY─┤ └─filename─┘
└─R/O────┘ (1)
Notes:
(1) The filename operand is allowed only where FILEAPPEND 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.
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.
The following streams and files are used by the FILEAPPEND stage:
input:
|...+....1....+....2....+....3....+....4.... c:\myfile.dat c:\myfile.dat d:\yourfiles\yourfile.dat .. .. d:\yourfiles\yourfile.dat
input:
|...+....1....+....2....+....3....+....4.... record record record .. .. record
input:
|...+....1....+....2....+....3....+....4.... record record record .. .. record
input:
|...+....1....+....2....+....3....+....4.... c:\myfile.datXrecord c:\myfile.datXrecord d:\yourfiles\yourfile.datXrecord .. .. d:\yourfiles\yourfile.datXrecord
output file:
...|...+....1....+....2....+....3....+....4.... **** Top of file **** 1 record 2 record 3 record . .. . .. 99 record **** End of file ****
output file:
...|...+....1....+....2....+....3....+....4.... **** Top of file **** 1 1Brecord 2 2Brecord 3 3Brecord . .. . .. 99 99Brecord **** End of file ****
output:
|...+....1....+....2....+....3....+....4.... record record record .. .. record
output:
|...+....1....+....2....+....3....+....4.... 1Brecord 2Brecord 3Brecord .. .. 99Brecord
CONSOLE | FILEIN | FILEOUT | IN | OUT