[Info-vax] Help with DECBasic: reading a record in an INDEX SEQ file using a compound key
FrankS
sapienza at noesys.com
Wed Jan 6 08:26:10 EST 2010
On Jan 6, 8:01 am, thick_guy_9 <jose.santos.mouri... at gmail.com> wrote:
> All
> I need some help with DECBasic. All the examples in the BASIC USER
> GUIDE use a simple key.
>
> This is how I open the file:
>
> OPEN sFILENAME AS FILE #1 &
> ,access modify &
> ,allow modify &
> ,map REC_MAP &
> ,organization indexed &
> ,primary (PAN, DOB) ! <======= NOTE &
> ,alternate LAST duplicates changes &
> ,alternate FIRST duplicates changes
>
> FIND #1, KEY #0 EQ "sMyPAN,sDOB", REGARDLESS
> GET #1
> The above Get command gives me a "RECORD NOT FOUND" error.
>
> Did I get the syntax correctly?
>
> Thanks!
Are sMyPan and sDOB string variables in your program? If the answer
is yes, then your program is very wrong.
The portion you show inside the quotation marks is the actual string
being searched for within the index. If sMyPan and sDOB are string
variables then you need something like:
FIND #1, KEY #0 EQ (sMyPan + sDOB), REGARDLESS
However, you may still have issues if sMyPan and sDOB are variable
length strings and the PAN and DOB fields in the mapped data structure
are fixed length.
www.noesys.com
More information about the Info-vax
mailing list