The -unload option creates a binary sequential file or a line sequential file from a Vision file. The command is:
vutil -unload [ -v ] [ -b | -t ] [-l] [ -q ] [ -r ] [ -k #] source destination
The source file is the Vision file to unload; the destination is the name of the file to create. If a file with the name destination already exists, it is deleted first. The records in the destination file are ordered by the primary key of the source file. This can be used to export data to other applications. vutil will not let you unload records from an encrypted file.
The source file is buffered according to the value in the A_SEQ_DEFAULT_BLOCK_SIZE variable. The variable must be set in the environment for vutil to use it. If the variable is not set, the default buffer block size is 4096 bytes. If the variable is set to "0", vutil -unload into a sequential file will perform record-based I/O. If the variable is set to a positive value, that value will be rounded up to the power of two equal to, or greater than the value. This will be the buffer size in bytes. The maximum buffer size is 1GB.
By default, the destination file is assumed to be a binary sequential file with an alternate format that is not compatible with the ACUCOBOL-GT runtime.
These are the destination file format options:
|-v||This option produces a file that has variable-length records. Variable-length records occupy only as much disk space as necessary.
Two or four bytes indicating record size are placed in front of each variable-length record when it is written to disk. (Different
machines generate different prefixes. Thus, files produced with
vutil -unload -v can be loaded with
vutil -load -v on the source machine but are not necessarily portable to other machines.) The two- or four-byte field that is added to the
record is not specified in your COBOL program, but some programs that access the records need to be aware of the extra bytes.
If -v is not present, fixed-length records are written.
vutil -unload to produce a binary sequential file that is compatible with the ACUCOBOL-GT runtime.
If -v is not present, fixed-length records are produced.
The -v option causes vutil to produce variable-length records. The record length is stored in a two-byte record header.
|-l||This option places a read lock on the input Vision file. This improves performance, because the records can be read without needing to place and release locks on the individual records.|
vutil -unload to produce a file that has line sequential format. This means that the destination file is a simple text file, with records
separated by line feeds.
This option implies -v (variable-length records), so the -v option is not necessary, although it is allowed.
If a record within the source file contains a newline character, a warning is displayed. Newline characters are used to signal the end of a record in line sequential files, and so continuing would result in partial/incomplete records. If you encounter the warning, you should unload to a binary sequential file (option -b) instead.
|-q||This option causes vutil to exit (with status 99) if user interaction is required.|
|-r||This option reads the records from the source file in the order that they occur in the data file, without using the index;
the order of the records in the destination file is undefined.
Without this option, records are read in order according to the primary key or the key specified by the -k # option (if specified) as they are unloaded to the destination file. In a large file, reading all the records by the primary key can be slow if the actual record data is not generally ordered by the primary key.
If this option and the -k # option are both specified, the one that occurs on the command line last is the one in effect.
Note: This option is not effective when unloading Vision 3 files.
|-k #||This option specifies the key to be used to read the records as they are unloaded to the destination file. Substitute # for
the actual key number.
Without this option, records are read in order according to the primary key, or the order that they occur in the data file if -r is specified.
If this option and the -r option are both specified, the one that occurs on the command line last is the one in effect.