Chapter Contents


SAS Companion for the OpenVMS Operating Environment

External I/O

The following guidelines apply to reading and writing OpenVMS native files using the SAS System. For several of the suggestions, the larger your files, the more performance gain for your entire SAS job. These suggestions parallel several of the SAS data set I/O suggestions.

Allocating File Space Appropriately

Job type SAS procedures and DATA steps that write external files.
User SAS programmer.
Usage The ALQ= and DEQ= options are specified as part of the FILENAME or FILE statement.
Benefit Specifying appropriate values can decrease elapsed time up to 50 percent and reduce disk fragmentation.
Cost You will experience performance degradation when ALQ= and DEQ= values are incompatible with file size.

The SAS System allocates disk space for external files based on the value of ALQ=. It then extends the file if needed, based on the value of DEQ=. By default, the ALQ= value is 0 (indicating that the minimum number of blocks required for the given file format is used) and the value for DEQ= is 0 (telling OpenVMS RMS to use the process's default value). For more information about specifying the ALQ= and DEQ= options in a FILENAME or FILE statement, see FILENAME and FILE.

Every time a file must be extended, the system must search the disk for free space. This requires I/Os. When this is done repeatedly for large files, performance degrades. By setting larger ALQ= and DEQ= values for large files, this overhead will be reduced. Optimal I/O will occur when ALQ= is equal to the size of the file. Because this is not always feasible, it is better to underestimate the value for ALQ= and set a larger DEQ= value. This allocates enough space for a smaller file, while extending it occasionally to meet the demands of a larger file. Allocating too much space may be costly if /HIGHWATER_MARKING is set on the disk. (For more information, see Turning Off Disk Volume Highwater Marking.)

References for Allocating File Space

Turning Off Disk Volume Highwater Marking

Job type Jobs that write external files.
User System manager.
Usage Use the /NOHIGHWATER_MARKING qualifier when initializing disks. For active disks, issue the DCL command SET VOLUME/NOHIGHWATER_MARKING.
Benefit Elapsed time can be improved by up to 40 percent. Direct I/Os are reduced.
Cost There is no performance penalty. However, for security purposes, some OpenVMS sites may require this OpenVMS highwater marking feature to be set.

The SAS System uses the random access method when opening external files. This means that allocated disk space does not have to be processed in a sequential method. /HIGHWATER_MARK is a safeguard that clears disk space before it is allocated to remove residue of former files. To do this, the entire space allocated has to be overwritten. Overwriting the space costs some elapsed time and I/Os. If the data that are stored on the disk are not of a truly confidential nature, then a performance gain can be achieved by disabling highwater marking on this disk.

Two DCL commands can be used independently to disable highwater marking on a disk. When initializing a new volume, use the following to disable the highwater function:

$ initialize/nohighwater $DKA470 mydisk

To disable volume highwater marking on an active disk, use a command similar to the following:

$ set volume/nohighwater $DKA200

References for Turning Off Disk Volume Highwater Marking

Eliminating Disk Fragmentation

Job type Any jobs that access common external files frequently.
User System manager.
Usage You will need to devote a disk to frequently accessed files or keep your disks defragmented.
Benefit The savings on elapsed time depend on the current state of the disk, but the time can be reduced by up to 40 percent.
Cost The cost to the user is the time and effort to better manage disk access rather than letting the OpenVMS environment do all of the work. For the system manager, this may involve regularly defragmenting disks or obtaining additional disk drives.

On an unfragmented disk, files are contiguous, so after one I/O operation the disk head is well positioned for the next I/O operation. Split I/Os are rare on an unfragmented disk, which decreases elapsed time to perform I/O.

Where possible, dedicating a disk drive to frequent defragmentation can provide performance benefits. Use this disk to store commonly accessed SAS external files. In some situations, adding an inexpensive SCSI drive to the configuration may allow the system manager to maintain a clean, unfragmented environment more easily than maintaining a large disk farm. Files that are maintained on this unfragmented SCSI disk may perform better than heavily fragmented files on larger disks.

Specifying Default Multiblock Count

Job type Jobs that write large external files.
User SAS programmer.
Usage The MBC= option (multiblock count) is specified as part of the FILENAME or FILE statement.
Benefit Elapsed time may be improved by 25 to 35 percent on jobs that output large external files.
Cost Increasing multiblock count may slightly increase requirements for memory.

By default, the SAS System uses the default value for your process for the multiblock count specified by the RAB$B MBC field in OpenVMS RMS. You can use the MBC= external I/O option to specify the size of the I/O buffers that OpenVMS RMS allocates for writing or reading an external file. The MBC= option controls how many 512-byte pages of memory are reserved to perform file access. When you increase the buffer size, you use more memory.

We recommend a value of approximately 32 blocks for the MBC= option when you are writing a very large external file (over 100,000 blocks). You may see improvement in elapsed time up to 35 percent. Only minimal gains in performance will occur when you specify the MBC= option for reading an external file.

Note:   You can use the MBC= option to affect a particular file. If you want to specify a default multiblock count for your process that will affect all external files in your SAS program, use the DCL SET RMS_DEFAULT command.  [cautionend]

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.