VMS Help  —  SORT  Output File Qualifiers
    Must be specified immediately after the output file specification
    in the SORT or MERGE command line.

1    /ALLOCATION

    Specifies the number of blocks to be preallocated for the output
    file. Used for optimization when you know that the output file
    allocation will differ substantially from the total input
    file allocation (because you are reformatting data or omitting
    records).

    Format

      output-file-spec/ALLOCATION=n

1.1  –  Qualifier Value

 n

    Specifies the number of blocks to be allocated. A value of 1 to
    4,294,967,295 is allowed.

1.2  –  Full Description

    Sort/Merge preallocates space for the output file based on total
    input file allocation, thereby avoiding the overhead of extending
    the file every time another few blocks are written to it.

    However, if you know that the output file allocation will differ
    substantially from the total input file allocation (because you
    are reformatting data or omitting records), you can specify the
    number of blocks to be preallocated for the output file.

    The /ALLOCATION qualifier is required if the /CONTIGUOUS
    qualifier is used.

1.3  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT -
  _$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS

      This SORT command allocates 1000 contiguous blocks for the
      output file SUMMARY.LIS.

2    /BUCKET_SIZE

    Specifies the OpenVMS RMS bucket size (the number of 512-byte
    blocks per bucket) for the output file. Used with relative and
    indexed-sequential output disk files for optimization.

    Format

      output-file-spec/BUCKET_SIZE=n

2.1  –  Qualifier Value

 n

    Specifies the bucket size. A value of 1 to 32 is allowed.

2.2  –  Full Description

    Use the /BUCKET_SIZE qualifier with relative and indexed-
    sequential output disk files to specify OpenVMS RMS bucket size
    (the number of 512-byte blocks per bucket). If the output file
    organization is the same as for the input files, the default
    value is the same as the first input file bucket size. If output
    file organization is different, the default value is 1. The
    maximum number of blocks per bucket is 32.

2.3  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS1.DAT,STATS2.DAT -
  _$ SUMMARY.LIS/BUCKET_SIZE=16/RELATIVE

      This SORT command results in the output file SUMMARY.LIS that
      has a bucket size of 16 with relative organization.

3    /CONTIGUOUS

    Requests that the output file be stored in contiguous disk
    blocks, thereby decreasing access time. Note that you must also
    specify the /ALLOCATION qualifier because if the preallocated
    space is too small, OpenVMS RMS may be unable to extend the file
    contiguously.

    Format

      output-file-spec/CONTIGUOUS

3.1  –  Full Description

    By default, Sort/Merge does not allocate contiguous disk blocks
    for the output file. You can request, however, that the output
    file be stored in contiguous disk blocks by specifying the
    /CONTIGUOUS qualifier, thereby decreasing access time. If you use
    the /CONTIGUOUS qualifier, you must also specify the /ALLOCATION
    qualifier because if the preallocated space is too small, OpenVMS
    RMS may be unable to extend the file contiguously.

3.2  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT -
  _$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS

      This SORT command allocates 1,000 contiguous blocks for the
      output file SUMMARY.LIS.

4    /FORMAT

    Specifies the output file record format if it differs from the
    input file format.

    Format

      output-file-spec/FORMAT=(type:n ...)

4.1  –  Qualifier Values

 BLOCK_SIZE:n

    Specifies the output file's block size, in bytes, if you have
    directed the file to magnetic tape. You can also accept the
    default. If the input file is a tape file, the block size of
    the output file defaults to that of the input file. Otherwise,
    the output file block size defaults to the size used when the
    tape was mounted.

    Acceptable values for block size n range from 20 to 65,532. To
    ensure correct data interchange with other Compaq systems,
    however, specify a block size of not more than 512 bytes. For
    compatibility with systems that are not made by Compaq, the
    block size should not exceed 2,048 bytes.

 CONTROLLED:n

    Specifies variable with fixed-length control (VFC) records in the
    output file.

 n

    Optionally indicates the maximum record size (in bytes) of the
    output records. The maximum record size allowed depends on the
    file organization.

    Sequential files          32,767
    Relative files            16,383
    Indexed-sequential files  16,362

    These totals include control bytes. If you do not specify the
    maximum record size, the default is a length large enough to hold
    the longest output record.

 FIXED:n

    Specifies fixed-length records in the output file.

 SIZE:n

    Specifies the size, in bytes, of the fixed portion of VFC
    (CONTROLLED) records, up to a maximum of 255 bytes. If you do
    not specify SIZE, the default is the size of the fixed portion of
    the first input file. If you specify this size as 0, OpenVMS RMS
    defaults the value to 2 bytes.

 VARIABLE:n

    Specifies variable-length records in the output file.

4.2  –  Full Description

    If the sort operation is a record or tag sort, the default output
    record format is the same as the first input file record format.
    If the sort operation is an address or index sort, the default
    output record format is fixed record format. If the input files
    have different record formats, Sort provides an output record
    size that is large enough to contain the largest record in the
    input files.

    When you specify the output record format, you can indicate
    the maximum record size, in bytes, of the output records. You
    can specify fixed-length records, variable-length records, or
    variable with fixed-length control records.

4.3  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/FORMAT=FIXED:80

      The input file STATS.DAT consists of variable-length records
      that are 80 bytes in length. The /FORMAT qualifier specifies
      that the output file, SUMMARY.LIS, consists of fixed-length
      records.

5    /INDEXED_SEQUENTIAL

    Defines the output file organization as indexed sequential. The
    output file must exist and must be empty. Used with the /OVERLAY
    qualifier.

    Format

      output-file-spec/INDEXED_SEQUENTIAL

5.1  –  Full Description

    If the organization of the output file is to be different
    from that of the input files, then you must specify the
    new organization. Use the /INDEXED_SEQUENTIAL qualifier to
    define indexed-sequential organization for the output file.
    Additionally, the output file must exist and must be empty, and
    you must use the /OVERLAY qualifier.

5.2  –  Example

  $ CREATE/FDL=NEW.FDL AVERAGE.DAT
  $ SORT/KEY=(POS:1,SIZ:80) DATA.DAT,STATS.DAT -
  _$ AVERAGE.DAT/INDEXED_SEQUENTIAL/OVERLAY

      The CREATE/FDL command creates the empty file AVERAGE.DAT. The
      SORT command specifies that the output file have an indexed-
      sequential organization and be written to the empty file
      AVERAGE.DAT.

6    /OVERLAY

    Specifies an existing empty file that the output file is to be
    overlaid, or written to. The /OVERLAY qualifier is required when
    you use the /INDEXED_SEQUENTIAL qualifier.

    Format

      output-file-spec/OVERLAY

6.1  –  Full Description

    To specify that an empty file is to be overlaid with sorted
    records, use the /OVERLAY qualifier.

    If the input file organization is indexed-sequential, the output
    file must already exist and must be empty. If the output file
    is not empty, /OVERLAY does not write over the file. Instead, it
    appends the result of the sort to the existing output file.

    If the input file organization is sequential or relative, you can
    create an empty file for the sorted records using an OpenVMS RMS
    program and use the /OVERLAY qualifier to specify that the output
    file is to be overlaid.

    You can use the Create/FDL utility to create an empty data
    file; use the /OVERLAY qualifier to specify that Sort is to
    write output to that file. Any attributes that you specify when
    creating the empty file then become attributes of the Sort output
    file.

    See the OpenVMS Record Management Services Reference Manual for
    more information. You can also refer to this manual if you want
    to use the Convert utility to produce an indexed-sequential file
    on output.

6.2  –  Example

  $ CREATE/FDL=NEW.FDL AVERAGE.DAT
  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT AVERAGE.DAT/OVERLAY

      The FDL file NEW.FDL specifies special attributes for the
      file AVERAGE.DAT. When Sort writes output to that file, the
      resulting Sort output file has the attributes specified by the
      FDL file.

7    /RELATIVE

    Defines the output file organization as relative.

    Format

      output-file-spec/RELATIVE

7.1  –  Full Description

    If the organization of the output file is to be different
    from that of the input files, then you must specify the new
    organization. If you do not specify file organization, the
    default for record and tag sorts is the organization of the
    first input file. You must use the /RELATIVE qualifier to specify
    relative output file organization.

7.2  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/RELATIVE

      Because the input file STATS.DAT is not a relative file and
      the output file, SUMMARY.LIS, will be, /RELATIVE qualifies the
      output file specification.

8    /SEQUENTIAL

    Defines output file organization as sequential. This is the
    default for address and index sorts. (The default for record
    and tag sorts is the organization of the first input file.)

    Format

      output-file-spec/SEQUENTIAL

8.1  –  Full Description

    If the organization of the output file is to be different from
    that of the input files, you must specify the new organization.
    If you do not specify file organization, the default for record
    and tag sorts is the organization of the first input file. If you
    do not specify file organization, the default organization for
    address and index sorts is sequential.

    Use the /SEQUENTIAL qualifier when the default is not sequential
    file organization and you want an output file with sequential
    file format.

8.2  –  Example

  $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/SEQUENTIAL

      Because the input file STATS.DAT is not a sequential file and
      the output file SUMMARY.LIS will be, /SEQUENTIAL qualifies the
      output file specification.
Close Help