Understanding Structural File Attributes

To copy or print a file properly, DUMPALL needs to know the following:

  • The structure of the input file

  • The size of the data records in the file

  • The size of the blocks of records in the file

For ordinary disk files and labeled tape files DUMPALL can automatically determine these requirements from the file attributes of the files. For such cases, DUMPALL can proceed to copy or print the files without requiring you to specify any file attributes—other than the file titles and kind of I/O units—in your DUMPALL commands.

However, there are other cases where you need to understand how certain file attributes affect DUMPALL so that you can specify the proper values in your DUMPALL commands. These cases include the following:

  • You want DUMPALL to copy a file so that the output file has different attributes from the input file.

    For this case, you must specify compatible file attributes for the output file, or DUMPALL cannot properly copy the file.

  • You want to print or copy files from an unlabeled tape.

    For unlabeled input tape files, you must specify the proper values for the file attributes, because DUMPALL has no way to determine them on its own.

  • You want to print or copy files from a tape generated by another operating system.

    The tape labels written by other systems might not always be compatible with ClearPath MCP label standards. Therefore, logical I/O and DUMPALL might not be able to determine the correct file attributes of the files on such tapes.

    For these cases, as for unlabeled tapes, you must specify the proper value for the file attributes, or DUMPALL cannot correctly process the file.

  • You want to print or copy a disk file, but the data records were written by a program that used different file attributes from the program that initially declared and created the file.

    For a case like this, specify in the DUMPALL commands the values of the file attributes used by the program that wrote the data records into the file, because the values that DUMPALL obtains automatically from the system might not work properly.

You might sometimes have a combination of these cases, such as when you want to copy a file from an unlabeled tape and give the output file—labeled or unlabeled—some different attribute values, such as a different BLOCKSIZE.

For a complete discussion of all file attributes, refer to the File Attributes Programming Reference Manual.

General Information about DUMPALL File Attributes

The file attributes that DUMPALL uses for each input and output file have a large effect on whether DUMPALL prints or copies files correctly. The values for file attributes that DUMPALL uses when it processes a file are determined by the following criteria (in order of precedence):

  1. The values you explicitly specify for file attributes in each DUMPALL command.

    Note: Your explicit values have the highest precedence, and they override values obtained from file labels, values that output files inherit from input files, and default values.
  2. For input files and existing output files, the values that the system obtains from file labels or headers.

    Note: The CAT command with a TO <file name> clause writes output to an existing output file instead of creating a new output file.
  3. For output files that DUMPALL creates, the values of the corresponding file attributes of the first input file.

    Note: COPY operations cause the new file to inherit the FILETYPE of the old file after the OPEN operation by initially setting the FILETYPE of the new file to 7. Unfortunately, BNA logical I/O causes the OPEN operation to fail because it supports only FILETYPEs 0 and 3. Therefore, when you are copying files to another host, you must explicitly specify a FILETYPE that is supported by BNA for the new file in the COPY command.
  4. The default values established by the system and DUMPALL.

For input files, DUMPALL sets the file attribute DEPENDENTSPECS equal to TRUE unless you perform one or more of the following actions:

  • Explicitly set the DEPENDENTSPECS attribute equal to FALSE.

  • Explicitly specify a nonzero value for the MAXRECSIZE or BLOCKSIZE file attribute.

    Note: If you set only one of these attributes, the other one is set to the same value by default.
  • Input an unlabeled tape file by using the UL or FR options, or set the file attribute KIND equal to TAPE and the file attribute LABEL equal to OMITTED or OMITTEDEOF.

Refer to the explanation of DEPENDENTSPECS in the File Attributes Reference Manual for an explanation of the other file attributes affected by DEPENDENTSPECS.

For each input and output file, DUMPALL prints a report of the file attributes it used for that file. You can use these reports to ensure that the correct attribute values were used. These reports can also aid you in figuring out why DUMPALL did not print or copy records correctly. For example, if the wrong BLOCKSIZE or MAXRECSIZE is used, the data in some of the records that are printed or copied might be missing or shifted.

In the syntax of DUMPALL commands—such as the CAT and COPY commands—you can specify file attributes for the input files and the output files. It is important to put your file attribute specifications in the correct place in the command. For example, if you want to copy a file from an unlabeled tape, make sure you specify the file attributes of the input file in the location of the CAT or COPY command that is reserved for specifying the attributes of the input file, rather than the location reserved for specifying the attributes of the output file.

Use of the following file attributes affect how DUMPALL reads and writes files:

  • The structure of records in a file—whether the file has fixed length records or variable length records—and so forth, is determined by the BLOCKSTRUCTURE file attribute.

  • The size of records is determined by the FRAMESIZE and MAXRECSIZE file attributes. In the case of files with variable length records, the size is limited by MINRECSIZE.

  • The size of blocks is determined by the FRAMESIZE and BLOCKSIZE file attributes.

  • The following attributes apply to disk files:

    • The method of accessing a file—whether it is a KEYEDIO file or a NOTRESTRICTED file—is determined by the FILEORGANIZATION file attribute.

    • How the file is placed on disk—whether or not it is a STREAM file—is determined by the FILESTRUCTURE attribute.

Notes:
  • When DUMPALL is copying to a disk file, and the input file is a disk file, DUMPALL sets the FILESTRUCTURE of the output file to the FILESTRUCTURE of the input file if the FILESTRUCTURE of the input file was explicitly specified at the time it was created, or if the input file was created with direct I/O.

  • DUMPALL does not set the FILESTRUCTURE of the output file to ALIGNED180 if the input file has received that value by default, so that when the default value changes to STREAM on a future release, the copied file will receive the value of STREAM by default.

  • Because it is not possible to determine the source of the FILESTRUCTURE attribute of a file on another host or whether a file on another host was created with direct I/O, when it is copying files from another host, DUMPALL sets the FILESTRUCTURE of the output file to that of the input file on the other host only when the FILESTRUCTURE of the input file is not ALIGNED180.

  • DUMPALL does not set the FILESTRUCTURE of the output file if the input file is not a disk file.

MAXRECSIZE and BLOCKSIZE are measured in FRAMESIZE units. FRAMESIZE can have the following values:

Value

Meaning

8

8 bits or one character or byte

48

48 bits or one word

4

4 bits or one digit

Thus, to say that a file has a record size of 70 is not precise unless you know what the value of the FRAMESIZE file attribute is. If FRAMESIZE is 8, then a record size of 70 means 70 bytes. But if FRAMESIZE is 48, then a record size of 70 means 70 words, or 420 bytes.

Note: Tapes written by other operating systems are generally written with FRAMESIZE=8. Unfortunately, the default value for FRAMESIZE is 48 when DUMPALL is reading from a tape that you specify with the UL or FR options. So when you specify UL or FR to read a tape generated by an operating system other than a ClearPath MCP system, you should explicitly specify FRAMESIZE=8.

The way that DUMPALL handles MAXRECSIZE and BLOCKSIZE depends on whether the file has fixed length records or variable length records.

Attributes for Files with Fixed-Length Records

In a file with fixed-length records, all the records have the same length. The size of the records is specified by the value of the MAXRECSIZE file attribute. The size of blocks in a file with fixed-length records should be an integer multiple of the size of the records and is specified by the value of the BLOCKSIZE file attribute. For example, a file with fixed-length records with a MAXRECSIZE of 80 could have a BLOCKSIZE of 80, 160, or 240, and so fourth.

For a file with fixed-length records, the BLOCKSTRUCTURE file attribute has the value FIXED.

For a file with a FILESTRUCTURE of STREAM, use the MAXRECSIZE attribute rather than the BLOCKSIZE attribute.

By default, when you use the CAT command with the GIVING option, or when you use the COPY command, DUMPALL sets the attributes for the output file equal to those of the input file. You can also give the output file other attribute values as necessary:

  • You can change the block size of the output file by specifying a new BLOCKSIZE value, but you should pick a size that is an integer multiple of the record size.

  • You can change the record size of the output file by specifying a new value for the MAXRECSIZE attribute:

    • If the new value is larger than the size of the input records, DUMPALL pads the output records with trailing binary zeros.

    • If the new value is less than the size of the input records, DUMPALL truncates the trailing part of each input record when DUMPALL writes the record to the output file.

  • When you change the value of the MAXRECSIZE attribute, you might also need to change the value of the BLOCKSIZE attribute so that it is an integer multiple of the new record size.

  • You can change the value of the FRAMESIZE attribute of the output file. If you do this, you might also want to make corresponding changes in the MAXRECSIZE and BLOCKSIZE attributes. For example, if you change the FRAMESIZE value from 48 to 8 (from words to bytes) you should multiply both the MAXRECSIZE and BLOCKSIZE values by 6; otherwise the records DUMPALL writes to the output file contain only one-sixth of the data that the input records contain.

  • If the output file is a tape file and the desired blocksize value is an odd number, include the ODDBLOCKSIZE=TRUE specification in the file attribute list for the output file.

Attributes for Files with Variable-Length Records

You can use DUMPALL to copy and print most files with variable-length records and variable-length blocks. The structure of the variable-length blocks and records in file is determined by the BLOCKSTRUCTURE file attribute. For files with variable-length records, this attribute has one of the following values: EXTERNAL, LINKED, VARIABLE, VARIABLEOFFSET, or VARIABLE2. DUMPALL normally opens input files with DEPENDENTSPECS=TRUE. In general, when you want to print or copy a labeled ClearPath MCP file with variable-length records, you should leave DEPENDENTSPECS=TRUE, and you should not specify any of the attributes that control variable-length size. It is easier and safer to let logical I/O automatically pick up the proper values for BLOCKSTRUCTURE, BLOCKSIZE, MAXRECSIZE, and MINRECSIZE. In addition, for files with BLOCKSTRUCTURE=VARIABLEOFFSET, let logical I/O pick up the values for SIZEMODE, SIZEOFFSET, and SIZE2. For unlabeled files and for files generated by operating systems other than the ClearPath MCP operating system, DUMPALL is able to read the file correctly only if it has one of the structures that logical I/O supports, and if you specify the proper values for the attributes of the input file.

When DUMPALL copies or prints files with variable-length records, the utility proceeds as follows:

  1. It issues read requests with lengths of the MAXRECSIZE attribute.

  2. Logical I/O transfers the number of characters or words that the record has—up to the value of MAXRECSIZE---into the input buffer for DUMPALL.

  3. DUMPALL checks to see how much data was transferred for the record.

  4. DUMPALL then prints or writes that much data to the output file.

In the case of a COPY or CAT command, if the output file has a different MAXRECSIZE or MINRECSIZE value than the input file, some records might be truncated or padded when they are written to the output file—except for files with BLOCKSTRUCTURE=EXTERNAL or BLOCKSTRUCTURE=LINKED.

When you copy a file with variable-length records, you can specify new values for the BLOCKSIZE and MAXRECSIZE attributes of the output file when you want the new file to have larger or smaller blocks or records.

Files with BLOCKSTRUCTURE = EXTERNAL

For input files with BLOCKSTRUCTURE=EXTERNAL, if the value of the MAXRECSIZE attribute of the input file is equal to the value of the BLOCKSIZE attribute of the input file, DUMPALL can successfully copy and print the files.

If the MAXRECSIZE value is less than the BLOCKSIZE value, DUMPALL cannot determine the proper boundaries between the individual records in each block it reads. DUMPALL assumes that all the records in each block are MAXRECSIZE long, except that the last record in a block is shorter if the value of MAXRECSIZE is not an integer multiple of the MAXRECSIZE value. DUMPALL can copy these files from tape to tape, from disk to disk, and from tape to disk as long as the output files have the same values for BLOCKSIZE and MAXRECSIZE as the input files. But when you try to copy the files from disk to tape, to print the files, or to change the BLOCKSIZE or MAXRECSIZE of the output files, the results might not be entirely correct.

For an output file with a BLOCKSTRUCTURE=EXTERNAL, if the value of the MAXRECSIZE attribute is less than the length of some of the input records, DUMPALL proceeds as follows:

  1. DUMPALL writes the first part of an oversized input record to one output record.

  2. DUMPALL then writes the next part of the input record to the next output record, and so forth, until the oversized record is completely copied.

Files with BLOCKSTRUCTURE=VARIABLE, VARIABLE2, or VARIABLEOFFSET

DUMPALL can copy and print these files correctly—if you use the proper values for BLOCKSIZE, MAXRECSIZE, INTMODE, and FRAMESIZE; and in the case of BLOCKSTRUCTURE=VARIABLEOFFSET, if you use the proper values for SIZEMODE, SIZEOFFSET, and SIZE2. When copying these files, you can specify new values for BLOCKSIZE and MAXRECSIZE for the output file, and you can even specify that the output file have a different BLOCKSTRUCTURE value, such as FIXED or EXTERNAL.

Files with BLOCKSTRUCTURE=LINKED

This kind of file is usually created by FORTRAN programs that execute WRITE statements without FORMAT statements and by ALGOL programs that execute binary WRITE statements—that is, WRITE statements with an asterisk (*) for the data count. LINKED files do not use the concept of record size as described by the MAXRECSIZE and MINRECSIZE attributes. In many cases DUMPALL cannot print or copy this kind of file correctly.

The information that follows briefly explains the internal structure of files with BLOCKSTRUCTURE=LINKED and under what circumstances DUMPALL can successfully print and copy these files.

  • When a program writes data to a LINKED file, the logical I/O subsystem puts special control words into each block before it writes the block to the file. One of the features of LINKED files is that the READ and WRITE statements in a program are not limited by the MAXRECSIZE or BLOCKSIZE attributes. A single WRITE statement in a program can transfer more data than can fit into a single block of the file, as determined by the BLOCKSIZE value. Logical I/O uses the control words to link together the data transferred by one WRITE statement into as many blocks as necessary. Subsequently, when a program tries to read that mass of data, logical I/O checks the control words and assembles data from all the blocks necessary. In summary, from the point of view of the program, each READ or WRITE statement transfers one record, but logical I/O might have to gather data from or distribute data to more than one block in the file.

  • When DUMPALL reads from a file, whether the file is LINKED or not, DUMPALL executes a READ statement with a length equal to the value of MAXRECSIZE. If the program that wrote the file used WRITE statements that transferred more data than the value of MAXRECSIZE, DUMPALL does not receive all the data when it reads such oversized, linked records. Thus, DUMPALL does not print or copy all the data in such records.

  • DUMPALL can correctly print all records in a LINKED file that are not longer than the value of MAXRECSIZE. DUMPALL prints only the first part of records that are longer than the MAXRECSIZE value of the input file.

  • DUMPALL can correctly copy all records in a LINKED file that are not longer than the value of MAXRECSIZE. DUMPALL copies only the first part of records that are longer than the MAXRECSIZE of the input file.

When you want either to add records to a LINKED file (with the CAT command) or to create a new LINKED file, DUMPALL correctly copies all the data that it reads from the input file to the output file even if the MAXRECSIZE or BLOCKSIZE values of the output file are smaller than the sizes of the input records.