Converting datatypes for result variables

Table 4-3 shows which data conversions are valid for result variables. A bullet indicates that conversion is possible, but be aware that certain types of errors can result if you are not careful when choosing host variable datatypes.

Table 4-3: Datatype conversions for result variables

From: Adaptive Server datatype

To: COBOL datatype

S9(1—9) COMP, COMP-4, COMP-5, BINARY

CS-DATE, CS-TIME, CS-DATETIME, CS-DATETIME4

PIC X(n)

S9(m)V9(n) DSLS, DSL, DSTS, DST, COMP, COMP-3

CS-MONEY, CS-MONEY4

char

•

•

•

•

•

varchar

•

•

•

•

•

bit

•

•

•

tinyint

•

•

•

•

smallint

•

•

•

•

int

•

•

•

•

bigint

•

•

•

•

ubigint

•

•

•

•

uint

•

•

•

•

usmallint

•

•

•

•

float

•

•

•

•

money

•

•

•

•

money4

•

•

•

•

numeric

•

•

•

•

real

•

•

•

•

date

•

time

•

datetime

•

•

datetime4

•

•

Key: DSL = Display Sign Leading DSLS = Display Sign Leading Separate DST = Display Sign Trailing DSTS = Display Sign Trailing Separate