Creating a homemade DATATYPE ?

Jan Vanbrabant

Creating a homemade DATATYPE ?

This is about PL1 support with DB2 SQL.

Migrating Datacom to DB2 for tables defined in Datacom with fields defined
as zoned decimal (PL1 PIC'9999'); in the (Datacom) application programs
we are using host variables defined as PIC'9999' too.

Loading data though from a flat file (created by Datacom) into DB2 table,
created with create table fieldname decimal(4), is working fine but data
is stored as fixed dec and using DCLGEN data field type is generated as
fixed dec.

So we should use host variables defined as fixed dec to use migrated
tables, but all our programs use datatype PIC'9999'.

This means we should check and change thousands of programs for the
host variables

We opened a PMR with IBM, but unfortunately there is no solution to continue
working with host variables defined as PIC'9999' …

DB2 does not have an analog for zoned decimal data type:


Every host variable type has it's equivalent between PL1 data types and the
right correspondence is always checked by precompiler. Even if the
correspondent column could be defined as char or integer in the DB2 table
the correspondent host variable gets changed nevertheless.


So the only solution we think there is, is to create a homemade DATATYPE.

Any advice, (nasty) experiences with this?


If we’ll do it, this will be a longterm solution; any
remarks/considerations/caveats from that perspective?

Your comments will be warmly welcomed.



* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________ membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!

If you need to change settings, is the home of IDUG's DB2-L