Retrieve Data Area Data (DTAARA) UDTF

Index

Schema IQUERY

DTAARA( DATA_AREA_LIBRARY => '*LIBL', 
        DATA_AREA => 'data-area-name', 
        STARTPOS => 1 (1 to 2000),
POSITIONS => -1 (1 to 2000) );
DTAARA( DATA_AREA => 'library/data-area', 
        STARTPOS => 1 (1 to 2000),
POSITIONS => -1 (1 to 2000) );

The Retrieve Data Area Data (DTAARA) User Defined Table Function returns one row containing the data area's content along with its attributes.

Parameters

Note: If the parameter keywords are NOT specified, users can call the DTAARA UDTF with positional parameters. To simplify use, the data area name may be specified as the first parameter. For example, in the following 3 statement, the data area MYAREA exists and QGPL is on the library list at the time it is run:

  1. dtaara('qgpl/myarea') 
  2. dtaara('myarea')
  3. dtaara('QGPL', 'MYAREA')

All three variations produce an identical result. When this style is used, it is recommended to use the full parameter list (option 3) to make the statement more clear, but it is not required.

DATA_AREA_LIBRARY

The library name of the data area. If unspecified, *LIBL is used.

DATA_AREA

The name of the data area whose content is returned. Any valid data area name may be specified, along with *LDA, *GDA and *PDA. When one of those three special values is specified, the library parameter is ignored. This is a required parameter. NOTE: When the 2nd form the UDTF is used, a fully qualified data area name can be specified, or a simple, unqualified name may be specified.

STARTPOS

Default: 1

The first position within the data area to return. If this parameter is not specified, position 1 is used.

POSITIONS

Default: -1 or NULL

The length of the data area to be returned, starting with the STARTPOS value and continuing for the number of bytes specified for this parameter. If this parameter is not specified, the data from the STARTPOS through the end of the data area is returned.  

Examples

  DCL-S OldParms CHAR(1024);
EXEC SQL select data_area_value FROM TABLE(iQuery.DTAARA('*LDA')) da INTO :OldParms;


ResultSet Columns

Column Data Type Description
DTAARA
VARCHAR(10)
The name of the data area.
DTAARALIB
VARCHAR(10) The library name where the data area is located.
DTAARATYPE
VARCHAR(5) The data area type, such as *CHAR, *DEC, or *LGL
LENGTH
INT The data area length.
DECPOS INT For Data Area Type *DEC, this column contains the number of decimal positions, otherwise it is null.
DATA_AREA_VALUE
VARCHAR(2000)
The current value stored in the data area. Note that if the STARTPOS or POSITIONS parameters are specified, the result is returned left-justified in this column.