SA_AamRead
SA_AamRead retrieves the first record that meets the key specification.
int SA_AamRead ( SA_FH AamFH, u8
*Buffer, u32 BuffLen,
u8 *KeyString, u32 KeyStringLen );
Note the following:
The buffer size (BufLen) must be equal to or larger than the {RecLen} parameter specified in SA_AamPrep plus one (1) for null termination.
A null buffer pointer will allow positioning to the indicated record without actually reading it.
The {KeyString} specifies a series of one or more keys. Each key is delimited with an 0x0D character.
The format of each key is the two digit key number, the match type letter from the table below, and the text to match.
The key number is established by the ordering of the key list in the SA_AamPrep and begins at one (1).
The matching may be left justified, right justified, exact, or floating (L, R, X, or F respectively).
The text to match must be equal to or less than the length of the target field. Otherwise, it will be truncated before use.
For floating matches, at least three (3) contiguous non blank, non don't care characters must be given if no left, ??right or exact keys are specified.
If {KeyString} is null, the last record read using the control block will be re-read.
The {KeyString} should not be a stack variable and should not be modified between the SA_AamRead statement and any associated SA_AamReadKG or SA_AamReadKGP statements.
Function return codes are as follows:
|
Value |
Meaning |
|
nn |
Length of the data read + 1. |
|
0 |
No more records meeting this key specification. |
|
-nn |
Error as described in Sunaccess Errors |
Example:
long fh;
char buffer[2048];
char keys[] = {"01XJohn",0x0D,"02FSmith,0x0D,"03L76540"};
SA_AamRead(fh, buffer, sizeof(buffer), keys, sizeof(keys));
![]() |