| Directives |
|
| Formats |
|
|||||||||||||||||||||||||
| Description | Use the MERGE directive to add program statements from a source file to the current (target) program. You can use a MERGE directive for serial or indexed files. You can also use it with Memory files. The source file must contain records that are statements in valid List format (i.e., with correct syntax, line numbers, etc.). | |||||||||||||||||||||||||
| *Warning* | During the MERGE process, if a statement from the source file has a line number matching a line number in the target program, the statement from the source file will overwrite the corresponding statement in the target program. | |||||||||||||||||||||||||
| You
have to include line numbers in the source file, but you
do not have to put them in numeric order. ProvideX reads
them into the target program in ascending sequence as if
they were entered in Command mode, but will place them in
the correct numeric sequence, using the source file's
numbering. If a source file contains a statement without a statement number, or with an invalid statement number (outside of the allowed range), ProvideX generates Error #21: Statement number is invalid and halts the MERGE process. ProvideX terminates the MERGE process when it encounters an End-of-File status in the source file. |
||||||||||||||||||||||||||
| See Also | INDEXED
Create Indexed File, *MEMORY* Create & Use Memory File, SERIAL Create a Sequential File |
|||||||||||||||||||||||||
| *Note* | MERGE does not support code generated using the LIST EDIT format. | |||||||||||||||||||||||||
| Format 1 | Specify Source File by
Channel
This opens the source file and use its current channel / logical file number to identify it. You can use this format with a memory-resident file (i.e., *MEMORY*). |
|||||||||||||||||||||||||
| Format 2 | Specify Source File by
Serial Filename
You can use a serial filename to identify it as the source for the MERGE (instead of opening it and referring to the channel). |
|||||||||||||||||||||||||
| Example | The
following is a sample terminal session using the MERGE
directive to combine two programs:
|
|||||||||||||||||||||||||