Data Types for SAP IQ

Overview

Every column in a table has a name and a data type. The data type tells SAP IQ how much physical storage to set aside for the column and the form in which the data is stored. This information includes information about SAP IQ data types, null and default values, and data conversions.

For more information about SAP IQ data types and to determine which data types are available for your version of SAP IQ, see your SAP IQ documentation.

SAS/ACCESS Interface to SAP IQ does not directly support any data types that are not listed below. Any columns using these types are read into SAS as character strings.

Supported SAP IQ Data Types

Here are the data types that SAS/ACCESS Interface to SAP IQ supports:

SAP IQ Null Values

SAP IQ has a special value called NULL. An SAP IQ NULL value means an absence of information and is analogous to a SAS missing value. When SAS/ACCESS reads an SAP IQ NULL value, it interprets it as a SAS missing value.

To indicate that NULL values are not allowed, you can specify in SQL that a column is NOT NULL. The NOT NULL designation tells SQL to reject any rows that contains NULL data values for those columns. For example, if you designate the Score column as NOT NULL for a table, then any attempt to load a row without a value for Score results in an error. When you create a table with SAS/ACCESS, you can use the DBNULL= data set option to indicate whether NULL is a valid value for specified columns.

You can also define SAP IQ columns as NOT NULL DEFAULT. For more information about using the NOT NULL DEFAULT value, see your SAP IQ documentation.

For your data, determine whether an SAP IQ column allows NULL values or the host system supplies a default value for a column that is specified as NOT NULL WITH DEFAULT. Knowing this information, you can write selection criteria and enter values to update a table. Unless a column is specified as NOT NULL or NOT NULL DEFAULT, it allows NULL values.

For more information about how SAS handles NULL values, see Potential Result Set Differences When Processing Null Data.

To control how SAS missing character values are handled, use the NULLCHAR= and NULLCHARVAL= data set options.

LIBNAME Statement Data Conversions

This table shows the default formats that SAS/ACCESS Interface to SAP IQ assigns to SAS variables when using the LIBNAME statement to read from an SAP IQ table. These default formats are based on SAP IQ column attributes.

LIBNAME Statement: Default SAS Formats for SAP IQ Data Types

SAP IQ Data Type

SAS Data Type

Default SAS Format

CHAR(n)1

character

$w.

VARCHAR(n)1

character

$w.

LONG VARCHAR(n)1

character

$w.

BIGINT

numeric

20.

SMALLINT

TINYINT

numeric

numeric

6.

4.

INTEGER

numeric

11.

BIT

numeric

1.

DOUBLE

numeric

none

REAL

numeric

none

FLOAT

numeric

none

DECIMAL(p,s)2

numeric

w.d

NUMERIC(10,4)

numeric

DOLLAR10.43

NUMERIC(19,4)

numeric

DOLLAR19.43

NUMERIC(p,s)2

(other than (10,4) or (19,4) formats)

numeric

w.d

TIME

numeric

TIME8.

DATE

numeric

DATE9.

TIMESTAMP

numeric

DATETIME25.6

1 The n in SAP IQ character data types is equivalent to w in SAS formats.
2 If a conflict might occur between the SAP IQ and SAS value for this data type, use SASDATEFMT= to specify the SAS format.
3 To change to a different format, use the DBSASTYPE= data set option to specify an alternative.

This table shows the default SAP IQ data types that SAS/ACCESS assigns to SAS variable formats during output operations when you use the LIBNAME statement.

LIBNAME Statement: Default SAP IQ Data Types for SAS Variable Formats

SAS Variable Format

SAP IQ Data Type

w.d

DECIMAL(p,s)2

DOLLAR19.4

(14 digits or fewer for the dollar value and up to 4 fractional digits)

MONEY

DOLLAR10.4

(6 digits or fewer for the dollar value and up to 4 fractional digits)

SMALLMONEY

other numerics

DOUBLE

$w

VARCHAR(n)1

datetime formats

TIMESTAMP

date formats

DATE

time formats

TIME

1 n in SAP IQ data types is equivalent to w in SAS formats.
2 p and s in SAP IQ numeric data types are equivalent to w and d in SAS formats.
Last updated: February 3, 2026