Purpose, Argument, Streams, Usage, Examples, Related
(2)┌─WRITE──┐
┌─NOCLOse─┐ ├─R/W────┤
>>──┬─>───────┬──┼─────────┼──┬───────┬──┼────────┼──┬──────────┬────────────────────><
└─FILEOUT─┘ └─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) FILEOUT cannot be specified as the first stage in a pipeline.
Use the FILEOUT stage to create a disk file or replace the contents of a disk file.
FILEOUT reads records from its primary input stream and writes them to the specified
file and to its primary output stream, if it is connected. FILEOUT appends a Line-Feed
character to each output record that it writes to the specified file, primary output
stream records are written unchanged. If the specified file does not already exist;
FILEOUT creates a new file containing the records read from its primary input stream.
If the specified file already exists, FILEOUT replaces the contents of the file with
the records read from its primary input stream.
If you do not specify a fully qualified path
and filename; the FILEOUT stage will create
a new file in the current working directory.
The following streams and files are used by the FILEOUT 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
The format of an intermediate work file is:
FILEOUT.TYPE=%s.FILE=%s.PID=%.5d.PIPE=%.4d.STAGE=%.4d.UNQ=%10.0d.DAT
Element Meaning ------- -------
%s The stage (DLL name) FILEOUT . separator TYPE=%s 'NEW' or 'SWAP' . separator FILE=%s The target output filename (including .ext if it is specified) . separator PID=%.5d The process identification number of the manager . separator PIPE=%.4d The pipeline number . separator STAGE=%.4d The stage number . separator UNQ=%10.0d A ten digit (unique) number derived from the current system time . separator DAT The file extension
**** Top of file **** Address Rxpipe
'pipe cons eof /stop/', '| xlate', '| recno >', '| console'
Exit 0 **** End of file ****
console:
CONSOLE(0): 'stop' to end. CONSOLE(0): ? one 1 ONE CONSOLE(0): ? flew over 2 FLEW OVER CONSOLE(0): ? the cuckoos 3 THE CUCKOO'S CONSOLE(0): ? nest 4 NEST CONSOLE(0): ? stop
keyboard.txt ...|...+....1....+....2....+....3....+....4.... **** Top of file **** 1 1 ONE 2 2 FLEW OVER 3 3 THE CUCKOO'S 4 4 NEST **** End of file ****
CONSOLE, >> (FILEAPPEND), > (FILEIN), IN, OUT