|
|
EDIT/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 EDIT/3000 COMMANDSJOIN |
|
The JOIN command appends or merges the contents of another MPE/3000 file into the WORK file. The form of the JOIN command is
The second occurrence of the linenumber is optional. If only one linenumber is specified, the entire file, starting with that linenumber, is joined, If no linenumber or #recnum is mentioned, the range of the JOIN command would include all of the records of the file. If the #recnum form is used and only one record is to be joined, the same #recnum must appear on both sides of the slash mark. For example,
The JOIN command is used to copy into the WORK file all or a portion of an MPE/3000 file to which you have access. If the SET FORMAT = DEFAULT option is in effect, EDIT/3000 assumes that the first or last eight bytes (depending on whether FRONT or REAR is currently set) of each record in the file to be copied contain the sequence number. If the SET FORMAT = COBOL option is in effect, EDIT/3000 disallows the SET REAR option and assumes that the first six bytes of each record in the file contain the sequence numbers. In either case, these bytes are not copied into the WORK file. If these bytes contain text that should be copied in the WORK file (as is usually the case with an unnumbered file), you will want to use the UNN option with the JOIN command to copy the entire record of each line. Alternatively, you may use a SET command with the appropriate SET options for the bytes which are to be copied. See paragraph 3-92 for a discussion of the SET command. EDIT/3000 assigns new line numbers to all lines copied by a JOIN command. If the TO linenumber (or ,linenumber) parameter is not specified, the new line numbers start with the value currently set for FROM (see paragraph 3-92 for a discussion of the SET command) or with the first available line in the WORK file (the last linenumber in the WORK file incremented by DELTA). If the TO parameter is used, the linenumbers start with the number specified. Succeeding lines are incremented by the SET DELTA = increment option in effect or by the BY increment (or ,increment) parameter specified in the JOIN command. In an interactive session, each line copied is displayed on the terminal (unless the Q parameter is included with the command). You may terminate the JOIN command by entering CONTROL Y. Any lines copied before CONTROL Y is entered remain in the WORK file. The contents of the joined file are unaffected. Any file to be copied into the WORK file with a JOIN command must
If the JOIN command is attempted on a KSAM file (see the KSAM/3000 Reference Manual), the following warning message is produced:
KSAM files are joined according to the primary key order. If the (linenumber/linenumber) range is specified and the line numbers are not the primary key, the results will be unpredictable. Several examples of the JOIN command are presented in the following examples. The location of the pointer is shown at the conclusion of each JOIN command.
The following example joins line numbers 2 through 4 from the file ADDFILE to the WORK file starting at line 2.1.
To join logical record numbers from a file to the WORK file, the (#recnum/#recnum) rangelist form is used as in the following example. Note that line numbers 1 through 3 (which are logical record numbers 0 through 2) are added to the WORK file.
If the JOIN filename form with no rangelist is used, as in the following example, the entire contents of the JOIN file are added to the end of the WORK file. In addition, since the TO linenumber was not included, the JOIN file contents are copied to the end of the WORK file.
|
|