SA_AamPrep
A file must be created or opened prior to any attempt to process data against it. SA_AamPrep creates a new data file and associated aamdex file.
SA_FH SA_AamPrep ( char *TxtName,
u32 *TxtNameLen, char *AamName,
u32 AamNameLen, u32
RecLen, char *OptKeyList,
u32 OptKeyListLength, u32 OpenMode );
Note the following:
Upon success of the function, the open file handle is returned.
If either the specified data or the AAM file exists, they will be deleted prior to creating the new files.
There is no implied close of an open file. If a file is opened and the file handle is used again in a subsequent open or prepare, the first file will remain open for the duration of the program.
The maximum record length supported is:
32,767 - 1 - sizeLEOR
Valid options in {OptKeyList} are:
|
Option |
Meaning |
|
D=c |
Specifies the universal matching character {c} for SA_AamRead operations. |
|
U |
Specifies non-case sensitive searches. |
|
W |
Write at end of file. |
|
P |
Primary key specification of the form: Pn=string or Pn#string where n is starting record position and string is up to 8 characters providing the primary record selection (=) or rejection (#) criteria. |
The {OptKeyList} field list form is:
key1start-key1end,...,keyNstart-keyNend
To
exclude a key field from the AAM file yet still allow searches on the field, prefix start-key with an
X as follows:
"D=#,U,1-24,73,97,X129-152"
Single character keys are allowable.
Function return codes are as follows:
|
Code |
Meaning |
|
+nn |
Success (file handle); |
|
-nn |
Error as described in Sunaccess Errors |
![]() |