SUNAAMDX
The SUNAAMDX utility creates an Associated Access Method (AAM) key file using the specified key positions in the corresponding data file. The command is executed using one of the following command lines:
|
|
|
|
| |
|
|
|
Note the following:
If no extension is specified for {txt}, TXT is assumed.
If {aam} is not specified, the file name in {txt} is used with the extension AAM. If {aam} is specified without an extension, AAM is used.
If neither {txt} nor {aam} are located in the current directory, the directories specified in the PLB_PATH environment variable are searched for the existence of both {txt} and {aam} files.
If the {log} file option is specified, all program messages are written to the file named by the {log} parameter. The following are the values for the {mode} parameter:
|
Mode |
Meaning |
|
L |
Write all messages to the log file. |
|
Q |
Append all messages to the log file. |
{Lnnnn} specifies the longest record length. A maximum record length of 65,529 bytes is supported. This parameter is required when creating or indexing a null file or when indexing a variable record length or space compressed file and the first record is not the longest record in the file.
If {Lnnnn} is not specified on the command line, the record length is determined by the first record in the data file. If the input file is of fixed length records, all records in the file are assumed to be that length during the SUNAAMDX procedure.
{opts} supports the following options:
B
D={c}
The ASCII character specified is the wildcard or don't care character for READ operations ('?' is the default).
I
Display the command line that constructed the AAM file.
I{ininame}
When specified, the utility will first look for any operational keywords in {inifile}. If the keyword is not found, the UET is searched. The filename specified by {ininame} must be a fully qualified name. If a full path is not specified, the filename must exist in the current working directory.
N
Disable the record counter display.
P{nn}{=|#}'xxx' MS-DOS
P{nn}{=|#}\'xxx\' Linux
The primary record selection criteria for partial indexing - 'xxx' may be up to eight (8) characters long.
O[={n}
The AAM file headers are marked for use by a Windows or Linux PL/B runtime. The {n} OS type value is optional. If the {n} value is not specified, the AAM files are marked for an OS type based on the operating system in use. If the {n} value is specified, the value must be one (1) for Windows or two (2) for Linux.
Examples:
sunaamdx data -1-5,O
If the utility is being executed under WIndows, the 'data.aam' aamdex file is marked such that a Windows runtime ( PLBWIN, PLBCON, ...) can open the AAM file. If the utility is being executed under Linux, then the 'data.aam' aamdex file is marked such that a Linux runtime ( PLB ) can open the AAM file.
sunaamdex data -1-5,O=1
The 'data.aam' aamdex file is marked such that a Windows runtime can open the AAM file.
sunaamdex data -1=5,O=2
The 'data.aam index file is marked such that a Linux runtime can open the AAM file.
Q
Quit without creating the output file if the input file does not exist.
R
Rebuild the index using stored command line.
S
Allow space compressed records in the data file.
U
Treats upper/lower case characters equally in all READ operations.
V
Allow variable length records.
W
Write all new records at the end of the {txt} file.
Y
Do not place {txt} drive information into AAM header.
Z
Do not place {txt} drive or path information into AAM header.
The wildcard or don't care character defaults to a question mark but may be changed by using the D option.
P{nn}{=|#}'xxx' is the primary record select option. It allows only records meeting the specified criteria to be indexed. The criteria match, up to eight bytes, starts at column 'nn' and the match is based on the data being equal to (=) or not equal to (#), the specified characters (‘xxx’). Records meeting the criteria are indexed while the others are ignored.
Records in the data file need not be in fixed and/or non space compressed format. If the 'S' option is given, the records may be both variable length and space compressed. If the 'S' option is given, the 'W' option is assumed.
Records written to the data file may be variable length and not be space compressed by using the 'V' option. As with the 'S' option, the 'W' option is assumed.
The 'W' option causes new records added to the file to be written at the end of file at all times. Deleted record space is not re-used and this space is not recovered until the file is reformatted.
It is possible to have all lower case letters treated as upper case during the search by specifying the 'U' option. This causes all lower case letters to be indexed as if they were upper case and treated as such during AAM I/O.
Up to 95 key specifications may be given and they may be continued to subsequent lines by terminating the line with a colon (:). Additional key specifications must then be given.
Individual key specifications must give a starting and ending record position, separated by a hyphen (-) unless a one byte key and must be separated by commas.
An 'X' immediately preceding an AAM key range (i.e., X1-10 or X10-20) indicates an excluded field. These are fields that may be used in conjunction with one or more valid AAM keys to retrieve records, but are not hashed into the AAM file. Their key position is relative to the other valid or excluded keys given in the keyspecs.
The data file is not re-written to discard any deleted record space. Only a new AAM file is created.
The order in which your fields are specified is critical during the READ operation. The first key specification is field number 1, the second is field number 2, etc.
Sub-fields are allowed. A key field may be wholly or partially contained within another field. Field 1 may be positions 1-10, while field 2 may be positions 3-5 and field 3 may be 7-14.
The information about the index file may be retrieved by specifying the index file name followed by the 'I' option. The command that was required to generate the file is displayed.
The index file may be reindexed without knowing any of the key specs by specifying the index file name followed by the 'R' option.
SUNAAMDX accepts a keyword named PLB_AAMUPPER={filename}. When this keyword is specified, the contents of the {filename} file are the uppercase translation table when the 'u' option is specified. Appropriate errors are given if the file specified cannot be opened, the file size is wrong, or the data cannot be read.
SUNAAMDX supports the PLB_FNC keyword that forces file names to lowercase or mixed case when they are created.
See Also: SUNAAMDX Examples, Utilities
![]() |