Hi!
I have an environment with DB2 for z/OS, Version 7.1.
I have unloaded a table with DSNUPROC. The new table to be loaded with the data has basically the same structure but with some additional columns.
The new columns shall be loaded with a default value, not necessarily with the DB2 default for the corresponding format but with a literal.
Searching the DB2 Utility Guide and Reference documentation I have found the NULLIF- and DEFAULTIF-settings:
(FIELD1 POSITION(*) CHAR(4)
FIELD2 POSITION(*) CHAR(3) NULLIF(FIELD1='SKIP')
FIELD3 POSITION(*) CHAR(5))
respectively
(FIELD1 POSITION(*) CHAR(4)
FIELD2 POSITION(*) CHAR(3) DEFAULTIF(FIELD1='SKIP')
FIELD3 POSITION(*) CHAR(5))
In that case FIELD2 would be intialized with SPACE since that is the DEFAULT for CHARACTER, correct?
But what I really want for example is to initialize FIELD2 uncondititonally always with the literal 'ABC' (which is not in the Load-File because FIELD2 did not exist in the unloaded table!).
Is it possible to initialize the new fields directly during the LOAD with specific literals as a default value? If so what is the correct syntax?
I already know that an update of all the new columns after the load with the standard DEFAULT using DEFAULTIF and a condition that is always true could be used as an ugly workaround, but that is not what I really want.
Thanks a lot for your support in advance!
Mathew