Hi NG,
I'm currently working on a small business database and now it is time to populate it with some data. For this purpose I'll use the LOAD utility. Unfortunately, I will not have any DB2 access till next month, so there is no possibility for me to prove, if the statements are actually correct... It would be very cool, if you could take a look at this.
DEPTFILE has 4 elements:
EL1 positions 01 to 04
EL2 positions 05 to 20
EL3 positions 21 to 40
EL4 positions 41 to 44
DEPTTABLE has 4 columns
COL1 CHAR 4 NOT NULL
COL2 INTEGER
COL3 VARCHAR 16 NOT NULL
COL4 VARCHAR 20
COL1 = "department shortcut"
COL2 = "number of employees"
COL3 = "department title"
COL4 = "comment"
COL1 is primary key!
The following command sould delete all existing data from the table
und populate it with the input data.
db2 load data
from DEPTFILE
of asc
modified by striptblanks usedefaults
method L (1 4,5 20,21 40,41 44)
null indicators (0, 0, 21, 41)
replace into DEPTTABLE (COL1, COL3, COL4, COL2)
If there are only blanks between 41 and 45, the value in COL2 will be NULL (no employees in the department). Zero would do just fine, but it's only an example.

If there are only blanks between 21 and 40, the value in COL4 will be NULL.
I do appreciate everyones help!!!
Thanks in Advance,
S.B.
P.S. Sorry for my bad English...
