FTCOPY - APPENDIX 1 FTCOPY COMMAND SUMMARY Blocking and Deblocking Concepts On magnetic tape a physical record is a string of bytes separated from other physical records by a blank space of tape called an inter-record gap. A logical record is a string of bytes which may or may not be separated from other logical records by an inter-record gap. A number of logical records may be strung together with no inter-record gap to form one physical record, also called a block. The operation of building the logical records into a physical record is called blocking. The operation of separating logical records apart and removing them from the physical record is called deblocking. Physical records on a tape on the VAX may contain any where from 14 through 65535 bytes. On the disk, physical records are called sectors. Generally speaking, VMS prohibits direct user access to sectors. Instead, it uses a package called RMS to read and write logical records. Thus, when FTCOPY reads from the disk (or ANSI tape), it gets logical records. It treats these logical records from the disk like physical records from foreign tape; thus, it can block and deblock them. Command Format and Explanation of Use Format FTCOPY input_file_spec output_file_spec Prompts From: input_file_spec To: output_file_spec In batch, all parameters must be specified as VMS can not prompt for command input. Command Parameters input_file_spec Specifies the name of the input file or foreign tape device from which data are to be read. No file name defaults are assumed and wildcarding is not permitted. output_file_spec Specifies the name of the output file or foreign tape device to which data are to be written. No file name defaults are assumed and wildcarding is not permitted. Command Qualifiers /TRANS=translation-code /NOTRANS Controls whether the input data are converted to an alternate data code before output. Translations can be performed between the following valid data codes: Translation-Code Meaning ASCTEBC ASCII to EBCDIC EBCTASC EBCDIC to ASCII 8AT7A 8 bit (standard) ASCII to 7 bit ASCII (used by Prime systems) 7AT8A 7 bit ASCII to 8 bit (standard) ASCII (used by VAX systems) USER User specified table in a file assigned the logical name FTC_TRAN The translation tables for EBCDIC, 8 bit ASCII, and 7 bit ASCII are built into FTCOPY. The EBCDIC to ASCII and ASCII to EBCDIC tables are taken from the VAX-11 Run Time Library while the 7 bit ASCII to 8 bit ASCII and 8 bit ASCII to 7 bit ASCII tables are built into FTCOPY using information obtained from Prime and DEC. Other data translation tables may be used by specifying the "USER" translation- code and building the table in a file assigned to the logical name FTC_TRAN. This option is useful if you are translating to some rare character code, translating byte length, binary data to another representation, or translating EBCDIC data to ASCII and specifying that all EBCDIC null's be changed to ASCII space's. A description of the "USER" translation table and how to build one is given in Appendix #3. When translation is specified, padding or keeping trailing data may also be specified. The bytes specified with the /PAD, /EVEN, and /TRAILING_DATA options will be automatically translated from the 8 bit ASCII character specified to the output code provided that the output code is EBCDIC or 7 bit ASCII. If the output code is 8 bit ASCII, you will be entering the pad, even, trailing_data characters in 8 bit ASCII and they will not need to be translated prior to being used. Any use of the /PAD, /EVEN, and /TRAILING_DATA qualifiers with the "USER" translation code will require you to enter the pad, even, trailing_data characters in the output code; FTCOPY will not translate these. The default condition is /NOTRANS. Input Qualifiers /BLOCK_SIZE=n Specifies the input block size where "n" is in bytes. If "n" or "/BLOCK_SIZE" is not specified, FTCOPY uses the size of the most recently read block as the default. For foreign tapes, the minimum block size is 14 bytes while the maximum is 65535 bytes. For RMS tape files the maximum block size is 9991 bytes while for disk files the maximum block size is 32767 bytes. For both RMS disk and tape files, the minimum size is 1 byte. For most applications this qualifier should not be specified since unexpectedly short or long blocks will cause FTCOPY to issue warning messages about the size difference. If an input block is longer than the specified size, FTCOPY will truncate the block and issue a message. If an input block is shorter than the specified size, FTCOPY will use the shorter size and issue a warning message. This qualifer is most useful, then, where input blocks may vary in size but you want to truncate long blocks and/or count the number of short blocks. n /FILES= ALL This qualifier specifies the number of files to be read from an input tape mounted as foreign, "n" is a positive integer or the word ALL. The word "ALL" instructs FTCOPY to process all of the files on the input device until the End-of-Volume mark is detected or until 32767 files have been read, whichever comes first. The default number of files to process is 1. If this qualifier is used with any RMS input file, FTCOPY will only read 1 file. If this qualifier is used, FTCOPY uses the same name for each output file but increases the version number with each new output file. For example, if 10 files are to be read from foreign tape and written to output file ABC.DAT; the output files will be ABC.DAT;1, ABC.DAT;2, ..., ABC.DAT;10. The first file read will be written to ABC.DAT version 1 and the last file read will be written to ABC.DAT version 10. /RECORD_SIZE=n Specifies the input record size where "n" is in bytes. If "n" or "/RECORD_SIZE" is not specified, FTCOPY uses the size of the current block as the default. You can specify record deblocking by specifying a /RECORD_SIZE smaller than the input block size. If the input block size is not evenly divisible by the input record size, FTCOPY may be instructed to retain or delete the trailing data in the block by use of the /TRAILING_DATA qualifier. /[NO]TRAILING_DATA=([RECORD:[y]][,BLOCK:[y]]) Specifies what FTCOPY is to do with extra bytes left over after deblocking is performed. Trailing data are left at the end of an input record when the input record size is greater than the output record size. Trailing data are left at the end of an input block when the input record size does not divide evenly into the input block size. /TRAILING_DATA may be used to retain extra data at the end of an input record, an input block, or both and to pad these bytes if necessary, into a full output record. The byte specified as "y" in the qualifier is used by FTCOPY to pad the trailing data into a full output record. /NOTRAILING_DATA, the default condition, causes FTCOPY to ignore any excess bytes. The byte "y" may be specified as a single ASCII character (A-Z, a-z, or 0-9); lower case letters must be enclosed in quotes ("). All special ASCII characters (+,$,%,&,...) and nonprinting characters are specified using their ASCII code in the form %bx where b represents the base of the code and x is the number of the ASCII character. Acceptable values for b are: D for decimal O for octal X for hexadecimal If the byte "y" is not specified, FTCOPY will use an ASCII space character for padding. If only one value (RECORD or BLOCK) is included, the parentheses need not be included. Output Qualifiers /BLOCK_SIZE=n Specifies the output block size where "n" is in bytes. If "n" or "/BLOCK_SIZE" is not specified, FTCOPY uses the size of the current output record size as the default. The /BLOCKSIZE and /RECORDSIZE qualifiers on the MOUNT command are not used by FTCOPY and have nothing to do with FTCOPY's blocking or deblocking a foreign tape. For foreign tapes, the minimum block size is 14 bytes while the maximum is 65535 bytes. For RMS tape files the maximum block size is 9991 bytes while for disk files the maximum block size is 32767 bytes. For both RMS disk and tape files, the minimum size is 1 byte. /[NO]EVEN[=y] If specified, this qualifier causes FTCOPY to pad output blocks to an even number of bytes. The byte "y" is specified as described above for /TRAILING_DATA. If "y" is not specified, FTCOPY uses an ASCII space character to pad blocks to an even number of bytes. If /NOEVEN is specified, the default condition, FTCOPY will not make the output blocks an even number of bytes. /RECORD_SIZE=n Specifies the output record size where "n" is in bytes. If "n" or "/RECORD_SIZE" is not specified, FTCOPY uses the size of the current input record size as the default. You can specify record blocking by specifying /BLOCK_SIZE larger than /RECORD_SIZE. If the output block size is not evenly divisible by the output record size, FTCOPY must be instructed to pad the block by using the /PAD=BLOCK:y qualifier describe below. Similarly, if the output record is larger than the input record, FTCOPY must be instructed on padding the end of the record by using the /PAD=RECORD:y qualifier. /[NO]PAD=([RECORD:[y]][,BLOCK:[y]]) Specifies what FTCOPY is to do when padding is required at the end of a record or block. /PAD may be used to pad an output record, an output block, or both. Record padding is required when the input record size is smaller than the output record size. Block padding is required when the output block size is not evenly divisible by the output record size. By using the /PAD qualifier, you can instruct FTCOPY to pad records and/or blocks with the desired byte "y" specified in the qualifier. If padding is required for the data to fill out the output block or the output record, the /PAD qualifier must be used as FTCOPY will not pad unless instructed to do so. /NOPAD, the default condition, causes FTCOPY not to pad the output records or blocks. The byte "y" is specified as described above for the /TRAILING_DATA qualifier. If "y" is not specified, FTCOPY uses an ASCII space character for padding. If only one value (RECORD or BLOCK) is included, the parentheses need not be included.