HP 3000 Manuals

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


HP Business BASIC/XL Reference Manual

IN DATASET 

The IN DATASET statement specifies the record format of a particular data
set.  It is used to unpack data after the data is retrieved from a
database by a SORT, SEARCH, or DBGET statement.  It is also used to
specify how data is packed for use by DBPUT and DBUPDATE statements.

The record format of a data set is required in order to accurately
compute the location of the sort key and to evaluate the search
condition.  Therefore, a program must contain IN DATASET statements to
SEARCH or SORT a database.  When used, this statement must correspond to
the record layout of the data set in the database.

If a string, string array, or numeric array is used as a formal parameter
in an IN DATASET statement a compile time error will occur when that
parameter is referenced before the sorted key in a SORT statement.

Syntax 

IN DATASET dataset USE [REALV] item_list 

Parameters 

dataset          A string expression with a maximum length of 16
                 characters.  Its value is the name of a data set.  The
                 name must be left-justified and, if shorter than 16
                 characters, must be terminated by a semicolon or blank.

REALV            The default real data type in a native mode program is
                 in IEEE floating point real format.  Therefore, REALV
                 must be specified in the IN DATASET statement if the MPE
                 V real data format is desired.

item_list        A list of any of the following separated by commas:
                   Scalar numeric variable
                   Scalar string variable
                   Substring
                   String or numeric array
                   String or numeric literal
                   A numeric literal type converted with one of the
                   following built-in functions:
                     SINTEGER
                     INTEGER
                     SREAL
                     REAL
                     SDECIMAL
                     DECIMAL

                 Space specifier:  SKIP number, where number is a numeric
                 constant.

Examples 

The following examples show the use of the IN DATASET statement.

     300    IN DATASET Dset$ USE A, B, SKIP 4, D$
     400    IN DATASET Dset$ USE 3.019,"Super",SREAL(1)

The SKIP feature is used to bypass data in a dataset record that is not
needed by the program.  The numeric constant that immediately follows
SKIP specifies the number of bytes to bypass.  There must be an IN
DATASET statement for each data set defined in the thread list.  Refer to
the THREAD IS statement description below for details about the thread
list.  The IN DATASET statement is a nonexecutable statement and is
treated internally like a PACKFMT statement.



MPE/iX 5.0 Documentation