|
|
FCOPY Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5 FCOPY FunctionsSUBSET |
|
Lets you copy only a specific portion, or subset, of a file. You can define the subset in one of two ways, either as all records with a certain character string or numeric pattern beginning in a specific column, or as a set or sets of continuous records.
Where:
You can define the subset in one of two ways, either as all records that have a certain character string or numeric pattern beginning in a specific column, or as a continuous set of records. Defining Subsets from Character Strings and Pattern Lists A character string describes a set of characters. Quotation marks delimit a character string. A character string can contain no more than 35 characters within the quotes, and it may not be continued from one line or record to the next. If you need to match quotation marks within the string, use two successive quotation marks, as each pair counts as one character. A pattern list is a set of octal or decimal numbers, each representing one byte. A pattern list is delimited by number signs (#), and can contain no more than 35 integers. You can continue a pattern list from one line or record to the next, but you cannot specify the continuation between elements of an individual pattern. Each decimal integer must be within the range 0 through 255, and each octal integer must be within the range 0 through 377. If the specified character string or pattern list does not exist entirely within a particular record in the fromfile, the record is not considered to be part of the defined subset. Defining Subsets from Record Ranges You can use record ranges to specify up to 255 subsets. FCOPY sequentially copies the subsets in the order you list them. They must be in numerical order, and they may not overlap. Using the SUBSET Function Alone You can use SUBSET alone to copy a disk file to a duplicate that uses less disk space. If you use SUBSET to copy data from a disk file that does not fill the space allocated to it to a new disk file, the resulting tofile is only as large as the actual contents of the fromfile. FCOPY does not copy the unused space. For example, the command below only copies 20 records from TEST1:
If you exit FCOPY and return to MPE, you can observe the effect of the FCOPY command by using LISTF to list the characteristics of the two files and compare them. For example:
Copying User Labels Only Use SUBSET=0,0 to copy just the user labels from a disk file. For example, the following command copies the user labels from the disk file LABELD to the labeled magnetic tape *TAPE.
Magnetic Tape Subsets FCOPY selects magnetic tape subsets by logical record number. If you need to use physical block subsets, you can temporarily define a logical record length equal to the physical record length. A subset may not extend over an EOF mark or a tape mark boundary on magnetic tape. Using SUBSET with DEBLOCK If you use SUBSET with DEBLOCK, FCOPY copies subsets from the deblocked records. The example below copies all records in the disk file AUTOS that contain the character string "BLUE" starting in character position 17, to the disk file COMPANY:
The following example copies all records in the file AUTOS that do not contain the character string "BLUE" in position 17, to the disk file RENTAL:
You can also use the SUBSET function to specify lowercase alphabetic characters from a terminal that has only uppercase characters. For example, the command below copies all records in the disk file DATA that contain the lowercase alphabetic characters "data" (octal codes 144, 141, 164, and 141) in character positions 77 through 80 to the disk file SUBFILE3:
You might use decimal codes to specify subsets containing nonprinting characters. For example, the command below copies all records in the disk file DATA1 that contain the nonprinting control characters CR and LF (decimal codes 13 and 10) in character positions 71 and 72 to the disk file SUB1:
The example below copies 500 records, beginning with record 0 (the first), from the disk file MAIN to the disk file SUB1:
The next example copies records 500 through 1499 of the disk file MAIN into the disk file SUB2:
The following example copies all records from 1500 through the end of the file from the disk file MAIN to the disk file SUB3:
You can copy several ranges of records as long as the ranges are sequentially ordered and do not overlap. For example, the command below copies records 0 through 11 and 30 through 74 from TAPEA to FILEONE:
|
|