Communicator e3000 MPE/iX Release 6.0 Express 1 (C.60.01) (30216-90286)

Chapter 3 31
Technical Articles
IMAGE/SQL Enhancement: P and Z Data Types
IMAGE/SQL Enhancement: P and Z Data Types
by Dolly Hu
Commercial System Division
This IMAGE/SQL enhancement allows application programs using Image/SQL to enter
unsigned data into TurboIMAGE/XL fields with P or Z data type.
Prior to this enhancement, Zoned Decimal and Packed fields, when written from an
application using IMAGE/SQL, were always populated with signed numbers. This created
a problem for some application programs reading the data. For example, a COBOL
program with a data item defined as Z4 in TURBO IMAGE, and 9(4) in the COBOL
program (note the absence of the “S”), a number of 942 gets stored as “094B” (signed), and
to the COBOL program, it is an invalid numeric.
IMAGE/SQL SPLIT command and UPDATE TYPE command have been enhanced to allow
SIGNED or UNSIGNED mapped type if the mapped type is DECIMAL. If UNSIGNED keyword is
specified, then all positive values written from an application using IMAGE/SQL are
unsigned. The default is SIGNED. If SIGNED/UNSIGNED key word is used with any mapped
type other than DECIMAL, then “Syntax Error” is returned by IMAGE/SQL.
SP[LIT]
Divides a large mapped column into two or more smaller columns.
SYNTAX
SP[LIT] MappedTable.MappedColumn INTO
NewMappedColumn:SourceType[:MappedType [SIGNED ]] [,...]
[UNSIGNED]
EXAMPLE
(i) SPLIT TABLE1.COLUMN5 INTO NEWCOLUMN1:I4:CHAR(8),&
NEWCOLUMN2:X20,&
NEWCOLUMN3:K3:DECIMAL(15,0)
(ii) SPLIT TABLE2.COLUMN3 INTO NEWCOL1:I4:CHAR(8),&
NEWCOL2:X20,&
NEWCOL3:Z4:DECIMAL(4,0) UNSIGNED