|
|
EDIT/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 EDIT/3000 COMMANDSTEXT |
|
The form of the TEXT command is
3-101. Description. A TEXT command that includes only the filename parameter copies the entire file into the WORK file. If the (linenumber/linenumber) parameter is included, only the records corresponding to the line numbers specified will be copied into the WORK file, and if the (#recnum/#recnum) parameter is included, only those records corresponding to the logical record numbers specified will be copied into the WORK file. (See paragraph 3-103, EXAMPLES.) If neither(linenumber/linenumber)nor (#recnum/#recnum) is used, the entire TEXT file contents are copied to the WORK file. If the filename and the UNNUMBERED option are not specified, they are implied from the previous KEEP or TEXT command (whichever was performed last) for that file. If only the filename, but not the option, is specified, the UNNUMBERED option is implied if the text file is unnumbered, and the EDITOR responds with the message,
For example,
If the UNNUMBERED option was not specified in the last KEEP or TEXT command, only the filename is implied from that command when the current TEXT command is executed. For example,
In an interactive session, if the TEXT command is used when the WORK file has been altered, EDIT/3000 asks if it is OK to clear the WORK file before the TEXT command is executed. If the response is other than YES or Y, the TEXT command is not executed. When a TEXT command is executed in batch mode, EDIT/3000 clears the WORK file automatically if it has been altered. If FIXED is currently set when the TEXT command is issued, the value of LENGTH is taken from the TEXT file (the maximum record length). If VARIABLE is set, LENGTH remains set at its current value. EDIT/3000 then resets RIGHT to the value of LENGTH and LEFT to 1, and sets FIXED or VARIABLE depending on whether the TEXT file is a fixed or variable record file. This has the advantage of giving you more control over your operating environment. For example, if you desire to expand the records of a fixed length record file, you may issue the SET LENGTH= colnum and SET VARIABLE commands before texting in the file. These same commands should be used for variable length record files. EDIT/3000 cannot calculate the maximum record length of variable length files, so it uses the block size. By setting VARIABLE and LENGTH when texting in or keeping a variable length record file, less disc space is used for the WORK and TEXT files and better performance can be obtained. If a file is saved with a KEEP, UNNUMBERED command (or otherwise created without sequence numbers), the TEXT command usually will be of the form TEXT filename, UNNUMBERED. New line numbers will be assigned by EDIT/3000 starting with the SET FROM = linenumber option in effect and incremented by the SET DELTA = integer option in effect. If the text file has variable length records (type "V"), then VARIABLE will be set. (See the SET command, paragraph 3-92.) When texting in unnumbered files from devices that cannot be rewound, the UNNUMBERED option should always be specified. Otherwise, one or more records will be lost from the beginning of the file. Any sequence numbers contained in a file specified by filename must be in the front or rear bytes as specified in a SET FORMAT, SET FRONT, or SET REAR command (see the SET command, paragraph 3-92). The sequence numbers will be interpreted as line numbers instead of being copied as part of the text. If the sequence numbers are not in bytes that match the SET FORMAT or SET FRONT/REAR conditions in effect, the command TEXT filename, UNNUMBERED should be used. Then, the sequence numbers will be copied as part of the text and new line numbers will be assigned by EDIT/3000, starting from the SET FROM = linenumber in effect and incremented by the SET DELTA = integer option in effect. If a file has been saved with the KEEPQ filename command, then the filename must be specified in a TEXT command for that file. If a file has been saved with the KEEPQ filename command, the file is saved in its structured "edit" format, instead of in the sequential format in which files normally are stored by the MPE/3000 file system. This is accomplished by appending EDIT/3000 variables to the file and assigning a filecode of 1050 or 1051 to the file. A filecode of 1050 signifies an EDIT/3000 KEEPQ file (DEFAULT) and a filecode of 1051 signifies an EDIT/3000 KEEPQ file (COBOL). All such files are intended to be read only by EDIT/3000, although SPL/3000 can read KEEPQ files also. A TEXT command to copy the contents of such a file into the WORK file renames the file. To prevent destruction of such a file, enter the commands TEXT filename and KEEP filename in a succession. (See paragraph 3-62 for a discussion of the KEEP command and the MPE Commands Reference Manual for a discussion of filecode and the MPE/3000 file system.) Texting in an empty file will result in error #23, FAILURE TO OPEN TEXT FILE (0), with File System error #0 (END OF FILE). Texting in a file with records greater than 256 bytes will result in error #24, RECORD SIZE TOO LARGE. The default TEXT file is limited to disc files on the local computer. If a device or remote file is being used, an MPE file equation (see the description of the :FILE command in the MPE Commands Reference Manual) must have been issued and an asterisk ( * ) must be used to back-reference the file. (See the example of texting in a card deck in paragraph 3-103). When texting in a numbered file, an extra data segment is required. Since a two-word entry is made in the extra data segment for every eight records texted in, the number of records that can be texted in is limited by the configured maximum size for extra data segments. Consult your System Manager to determine the maximum size for extra data segments (≤ 32K) and multiply it by 4 to determine the maximum number of records that can be texted in from a numbered file. There is no limit on the number of records when texting in unnumbered file. Trailing blanks are truncated from the records before they are placed in the WORK file. Therefore, if a search is made for a string which ends with blanks, the string will not be found if it is located at the end of a record. Several variations of the TEXT command are shown in the following examples. The location of the pointer is illustrated at the conclusion of each command.
If a numbered TEXT file is copied into the WORK file with a TEXT filename, UNNUMBERED command, EDIT/3000 treats the entire text record as data and generates sequencing information. In the following example, the file TEST (with a record size of 60 bytes) is copied into the WORK file with the T[EXT] TEST command, the first three lines are listed, and EDIT/3000 operation is terminated, Next, EDIT/3000 is accessed and the same file is copied into the WORK file with a T TEST,UNN command. When the first three lines are listed, note that EDIT/3000 has appended sequencing information to each record. When the WORK file is saved with the K TEST command, EDIT/3000 appends another set of sequencing information and now the record size is 68 bytes (as shown by the LISTF TEST,1 command). If the KEEP filename, UNNUMBERED form of the command is used, the sequencing information generated by EDIT/3000 will not be appended to the end of the records.
The next example illustrates the use of the TEXT filename command. Note that the FIND * command causes an error message to be displayed. (The pointer location is at line zero after a TEXT command is executed.)
The range (3/8) specified in the following example copies lines 3 through 8 of file EDIT2 into the WORK file. Note that the location of the pointer is still at line zero even though text starts at line 3.
To copy a TEXT file, located on cards, into the WORK file, perform the following steps as shown in the next example:
|
|