HP 3000 Manuals

DBFIND [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

DBFIND 

The DBFIND statement locates the master set entry that matches a
specified search item value.  It sets up pointers to the first and last
entries of the detail data set chain in preparation for chained access to
data entries which are numbers of the chain.  The path is determined and
chain pointers located on the basis of a specified search item and its
value.

Syntax 

                                            {str_expr1}
DBFIND dbname$, DATASET[=]dataset , ITEMS[=]{num_expr1} ,

      {str_expr2}
KEY[=]{num_expr2} , [STATUS[=]status_array(*)]

Parameters 

dbname$          A string variable, whose value is a TurboIMAGE database
                 name.  dbname must be the variable that was passed to a
                 successful DBOPEN.

dataset          A string expression with a maximum length of 16
                 characters.  Its value is the name of a detail data set.
                 The name must be left-justified and, if shorter than 16
                 characters, must be terminated by a semicolon or blank.
                 This parameter can also be an integer or short integer
                 corresponding to the desired dataset number.

str_expr1        A string expression that evaluates to the left-justified
                 name of a detail data set search item that has a maximum
                 length of 16 characters.  If shorter than 16 characters,
                 the value must be terminated by a semicolon or blank.

num_expr1        A numeric expression that evaluates to a short integer
                 referencing the search item number that defines the path
                 containing the desired chain.

str_expr2        If the dataset is to be read in CALCULATED mode (mode
                 seven), str_expr2 evaluates to the name of the search
                 item to be used in calculated access to locate the
                 desired chain head in the master data set.  The maximum
                 string length is 16 characters.

num_expr2        If the dataset is to be read in CALCULATED mode (mode
                 seven), num_expr2 evaluates to a short integer
                 referencing the search item number to be used in
                 calculated access to locate the desired chain head in
                 the master data set.  This can also be a short integer
                 numeric array.

status_array     A 10-element short integer array to which TurboIMAGE
                 returns an error code.  If an HP Business BASIC/XL
                 database statement specifies the STATUS option, an error
                 does not abort the program.  Following execution of the
                 database statement the program can check status_array 
                 and handle the error.  The values returned by TurboIMAGE
                 to this array are detailed in the description of the
                 status parameter of the equivalent TurboIMAGE library
                 procedure.

Examples 

     100 DBFIND Db$,DATASET Ds$,ITEMS K$,KEY A$
     110 DBFIND Db$,DATASET Ds$,ITEMS=N,KEY=A$
     120 DBFIND Db$,DATASET Ds$,ITEMS N1,KEY N2
     130 DBFIND Db$,DATASET Ds$,ITEMS=K$,KEY=N
     140 DBFIND Db$,DATASET Ds$,ITEMS K$,KEY A$,STATUS S(*)
     150 DBFIND Db$,DATASET Ds$,ITEMS=N,KEY=A$,STATUS=S(*)
     160 DBFIND Db$,DATASET Ds$,ITEMS N1,KEY N2,STATUS S(*)
     170 DBFIND Db$,DATASET Ds$,ITEMS=K$,KEY=N,STATUS=S(*)



MPE/iX 5.0 Documentation