Format /KEY=n A numeric value that specifies the key of reference that the Convert utility uses for reading records from the input indexed file. For example, you can specify the primary key as the key of reference by using the value 0 (/KEY=0), which is the default, or you can specify the first alternate key as the key of reference by using the value 1 (/KEY=1). The /KEY qualifier is valid for indexed input files only. If you use the /KEY qualifier, you must specify a key value (/KEY=0, /KEY=1, and so on). If you do not specify the /KEY qualifier, the default is the primary key (/KEY=0). /MERGE Specifies that records are to be inserted into their proper position in an existing indexed file. Format /MERGE /NOMERGE (DEFAULT) The /MERGE qualifier is useful when your input records are not sorted and you do not want them to be sorted as they are loaded into an output file. If you specify both /MERGE and /CREATE, /MERGE overrides the /CREATE qualifier. /PAD Determines whether short records are to be padded. Format /PAD [=[%b]x] /NOPAD (DEFAULT) Specifies that the short records are to be padded with either ASCII characters (A through Z, a through z, or 0 through 9) or numeric values. To specify x as a numeric value, you must specify the numeric base using the percent symbol (%) followed by one of the following characters: D Indicates that x is a decimal number. O Indicates that x is an octal number. X Indicates that x is a hexadecimal number. The numeric value can be any number from 0 to 255. /PROLOG Specifies the prolog version number of the output indexed file. Format /PROLOG=n Specifies the prolog number 1, 2, or 3. If you specify 2 for n, the output file will be either a Prolog 1 or a Prolog 2 file. If you specify 3, the Convert utility creates a Prolog 3 file for output. Prolog 3 files accept multiple keys (or alternate keys), all data types, and segmented keys. The only restriction to using a Prolog 3 file applies to files containing overlapping key segments for the primary key. In this case, you would have to use a Prolog 2 file. If you do not specify the /PROLOG qualifier, the Convert utility uses the prolog version of the first input file. If the input file is not indexed, the utility uses the RMS default. To see what this default is on your system, enter the DCL command SHOW RMS_DEFAULT. The /PROLOG qualifier overrides the value given with the FDL attribute KEY PROLOG. /READ_CHECK Specifies whether each input record is to be read from the file a second time and compared to the record originally read. Format /READ_CHECK /NOREAD_CHECK (DEFAULT) /SECONDARY Increases the Convert utility's performance by reducing the number of required passes through the input data. This is accomplished by placing alternate key information into the CONVWORK file. Format /SECONDARY=n Qualifier Value n Specifies the number of alternate keys that will be loaded to the CONVWORK file with each pass through the input data. This qualifier is valid when you are fast-loading a file with more than one alternate key. This option allows CONVERT to use more disk space for its work file than would be used by default. The default number of alternate keys written to the CONVWORK file is 1. /SHARE Specifies whether the input file is to be opened for sharing with other processes during the conversion. Format /SHARE /NOSHARE (DEFAULT) You can use the /SHARE option to generate a rough backup of a file that is always opened for sharing by some applications. However, another process can alter the records during the Convert utility operations. As a result, the consistency of the output file cannot be guaranteed. /SORT Specifies whether the input file is to be sorted before being loaded into an indexed file. The sort is done according to the primary key of the output file. Format /SORT [=FORCE] (DEFAULT) /NOSORT Two procedures can improve the sort performance: o Increasing the size of the working set for the duration of the sort. o Placing the input file, the output file, and the temporary work files on separate disk devices. By default, when there is a single indexed input file with the same primary key definition as the output file, CONVERT does not perform a sort of the primary key. If you specify the keyword FORCE, it forces a sorting operation for the primary key. If you specify /NOSORT with /FAST_LOAD, only the SORT of the primary key is disabled. Alternate or secondary keys are always sorted. The /NOSORT qualifier is useful when you know the input file is already in primary key order. /STATISTICS Determines whether statistics about the file conversion are to be displayed. Format /STATISTICS[=keyword] /NOSTATISTICS (DEFAULT) Keyword Meaning BRIEF Displays a summary of the file conversion at the completion of the operation. FULL Displays summary information at the completion of each key load containing Sort and Load statistics for the key. A summary of the file conversion is also displayed at the completion of the operation. If you specify the /STATISTICS qualifier without specifying a keyword, CONVERT defaults to /STATISTICS=BRIEF. The statistics produced by the Convert utility upon completion are as follows: o Number of files processed o Total records processed o Total exception records o Total valid records o Elapsed time o Buffered I/O count o Direct I/O count o Page faults o CPU time /TRUNCATE Specifies whether records that exceed the maximum record length for variable-length records, or records that exceed the specified record length for fixed-length records, are to be truncated. Format /TRUNCATE /NOTRUNCATE (DEFAULT) If you specify /NOTRUNCATE and a long record is encountered, the record is not written to the output file. If you specify the /EXCEPTIONS_FILE qualifier, the entire record is written to the exceptions file. /WORK_FILES Specifies the number of temporary work files to be used during the sort process. Format /WORK_FILES=n Specifies the number of work files you want. You can specify 0 or any value from 1 through 10. The default number of work files used during a sort is 2. This qualifier is valid when you are fast-loading a file with multiple keys or when you specify the /SORT qualifier. For more information about sorting, see both the /SORT and the /FAST_LOAD qualifiers. /WRITE_CHECK Specifies whether all writes are to be checked by comparing the new disk records with the original records in memory. Format /WRITE_CHECK /NOWRITE_CHECK (DEFAULT) If you use this switch, each new record on the disk is read and then compared with the original record in memory. 3 Examples 1.$ CONV/NOCREAT/TRUNC/EXCEPTIONS_FILE=EXFILE VARFILE.DAT FIXFILE.DAT This command causes the Convert utility to copy records from a file with variable-length records (VARFILE.DAT) to a file with fixed-length records (FIXFILE.DAT). Records longer than the fixed length are truncated, and short records are copied to the exceptions file EXFILE.EXC. 2.$ CONVERT FILE.IDX FILE.IDX This command creates the output file FILE.IDX with a version number one higher than that of the input file. The output file is a copy of the input file, but it is a clean copy without bucket splits, RRVs (record reference vectors), or pointers to deleted records. The performance of the output file is also improved. Note that the Convert utility establishes new record file addresses (RFAs) during such reorganizations. 3.$ CONVERT/FDL=TEST.FDL TRNTO::DBA1:[EXP]SUB.DAT OUT.DAT This command creates a new sequential file OUT.DAT with stream record format at the local node, according to the specification in the previously created FDL file TEST.FDL. The input file SUB.DAT at remote node TRNTO is sequential with variable-length record format. The Convert utility copies records from SUB.DAT to OUT.DAT, changing the format of the records. The contents of the FDL file TEST.FDL are as follows: SYSTEM SOURCE VAX/VMS FILE ORGANIZATION SEQUENTIAL RECORD BLOCK_SPAN YES CARRIAGE_CONTROL CARRIAGE_RETURN FORMAT STREAM SIZE 0 4.$ CONVERT MASTER.DAT DENVER::DB1:[PROD]MASTER.SAV This command creates a new file called MASTER.SAV at remote node DENVER from the file MASTER.DAT at the local node. Because the /FDL qualifier is not used, the new file has the same file organization and record format as the original file. The action of this CONVERT command is similar to that performed by the COPY command. However, CONVERT transfers the file record by record and thus does not use block I/O. 5.$ CONVERT/APPEND SALES.TMP KANSAS::[200,2]SALES.CMD This command causes records from the file SALES.TMP at the local node to be added sequentially to the end of the output file SALES.CMD at remote node KANSAS. The file SALES.TMP is sequential with variable-length record format, and the file SALES.CMD is sequential with stream record format. When the Convert utility loads records from the input file to the output file, it changes the record format. 6.$ CONVERT/FDL=FIXED/PAD=0/TRUNCATE INFILE.VAR OUTFILE.FIX This command creates the fixed format file OUTFILE.FIX and then loads it with records from the variable input file INFILE.VAR. Before they are loaded, any short records from the input file are padded with an ASCII 0 character, and any long records are truncated. 7.$ CONVERT/FDL=SYS$INPUT FORT.DAT STREAM.DAT FILE ORGANIZATION SEQUENTIAL RECORD CARRIAGE_CONTROL CARRIAGE_RETURN FORMAT STREAM This command converts the FORTRAN carriage control file FORT.DAT to a stream file that prints or types identically. The number of records may differ, and the FORTRAN carriage control information is removed from the records. 8.$ CONVERT/FDL=SYS$INPUT FORT.DAT VAR.DAT FILE ORGANIZATION SEQUENTIAL RECORD CARRIAGE_CONTROL CARRIAGE_RETURN FORMAT VARIABLE This command converts the FORTRAN carriage control file FORT.DAT to a variable-length record file. The FORTRAN carriage control information is preserved as the first data byte, and the number of records in the output and input files is the same. 2 /RECLAIM Invokes the Convert/Reclaim utility (CONVERT/RECLAIM) to make empty buckets in Prolog 3 indexed files available so that new records can be written in them. If all the records in a bucket have been deleted, that bucket is locked until the Convert /Reclaim utility makes it available. Unlike the CONVERT utility, the Convert/Reclaim utility maintains record file addresses (RFAs). The /RECLAIM qualifier is required. For a complete description of the Convert/Reclaim utility, including more inform- ation about the CONVERT/RECLAIM command and its qualifier, see the OpenVMS Record Management Utilities Reference Manual. Format CONVERT/RECLAIM filespec 3 Parameter filespec Specifies the Prolog 3 indexed file in which you want to reclaim buckets. When you use the CONVERT/RECLAIM command, the file cannot be opened for shared access. 3 Usage_Summary Invoke the Convert/Reclaim utility by entering the CONVERT /RECLAIM command at the DCL level. Exit the Convert/Reclaim utility by letting the utility run to successful completion. The Convert/Reclaim utility produces an output file only if you specify the /STATISTICS command qualifier. If you want to execute CONVERT/RECLAIM commands over a network, you need NETMBX privilege. 3 Qualifiers /KEY The /KEY qualifier lets you reclaim index buckets for specified keys. Format /KEY=key_number[,...] filename If you request statistics and specify the /KEY qualifier, the utility reports the statistics for each key separately. If you do not use the /KEY qualifier, the default is to reclaim all index buckets and to provide a single report. /STATISTICS Determines whether statistics about the completed conversion and reclamation are displayed. If you specify reclamation of index buckets by key, a separate set of statistics is returned for each specified key. Format /STATISTICS /NOSTATISTICS (DEFAULT) The Convert/Reclaim utility provides the following statistics: o Total buckets scanned o Data buckets reclaimed o Index buckets reclaimed o Total buckets reclaimed o Elapsed time o Buffered I/O o Direct I/O o Page faults o CPU time