Here is my db2 table ddl:
CREATE TABLE T1EMP
( EMPNO CHAR(6) NOT NULL,
FIRST_NAME CHAR(20) NOT NULL,
MIDDLE_INITIAL CHAR(1),
SEX CHAR(1),
BIRTHDATE DATE,
PHONE CHAR(4),
HIRING_DATE DATE,
JOB CHAR(20),
EDUCATION SMALLINT NOT NULL)
PARTITION BY (EMPNO ASC)
( PARTITION 1 ENDING AT ('000150'),
PARTITION 2 ENDING AT ('000230'),
PARTITION 3 ENDING AT ('001000') )
IN TESTD.T2TSEMPL;
( EMPNO CHAR(6) NOT NULL,
FIRST_NAME CHAR(20) NOT NULL,
MIDDLE_INITIAL CHAR(1),
SEX CHAR(1),
BIRTHDATE DATE,
PHONE CHAR(4),
HIRING_DATE DATE,
JOB CHAR(20),
EDUCATION SMALLINT NOT NULL)
PARTITION BY (EMPNO ASC)
( PARTITION 1 ENDING AT ('000150'),
PARTITION 2 ENDING AT ('000230'),
PARTITION 3 ENDING AT ('001000') )
IN TESTD.T2TSEMPL;
This my flat file that is stored at mainframe system:
1 2 3 4 5 6 7 8
1...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
000200 DAVID D M 06/27/1990 2200 02/12/2000 DBA 10
000210 WILLIAM W M 09/12/1970 1234 09/11/1998 PROGRAMMER 10
000220 JENNIFER J F 10/23/1978 2345 02/15/1983 PROGRAMMER 10
1...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
000200 DAVID D M 06/27/1990 2200 02/12/2000 DBA 10
000210 WILLIAM W M 09/12/1970 1234 09/11/1998 PROGRAMMER 10
000220 JENNIFER J F 10/23/1978 2345 02/15/1983 PROGRAMMER 10
Here is part of my load JCL:
//DSNUPROC.SYSIN DD *
LOAD DATA INTO TABLE DB2TA.T1EMP
(EMPNO POSITION(1) CHAR(6),
FIRST_NAME POSITION(07) CHAR(20),
MIDDLE_INITIAL POSITION(27) CHAR(1),
SEX POSITION(28) CHAR(1),
BIRTHDATE POSITION(29) DATE EXTERNAL(10),
PHONE POSITION(39) CHAR(4),
HIRING_DATE POSITION(43) DATE EXTERNAL(10),
JOB POSITION(53) CHAR(20),
EDUCATION POSITION(73) SMALLINT
)
(EMPNO POSITION(1) CHAR(6),
FIRST_NAME POSITION(07) CHAR(20),
MIDDLE_INITIAL POSITION(27) CHAR(1),
SEX POSITION(28) CHAR(1),
BIRTHDATE POSITION(29) DATE EXTERNAL(10),
PHONE POSITION(39) CHAR(4),
HIRING_DATE POSITION(43) DATE EXTERNAL(10),
JOB POSITION(53) CHAR(20),
EDUCATION POSITION(73) SMALLINT
)
When I use load utility to load data from flat file to table T2TSEMPL, the column for EDUCATION shows as -3600, which is not correct. The rest of the columns shows correct data.
Then, I changed my flat file:
000200 DAVID D M 06/27/1990 2200 02/12/2000 DBA +10
000210 WILLIAM W M 09/12/1970 1234 09/11/1998 PROGRAMMER +10
000220 JENNIFER J F 10/23/1978 2345 02/15/1983 PROGRAMMER +10
000210 WILLIAM W M 09/12/1970 1234 09/11/1998 PROGRAMMER +10
000220 JENNIFER J F 10/23/1978 2345 02/15/1983 PROGRAMMER +10
The column for EDUCATION shows as 20209, and the rest of the columns shows correct data.
This is first time I use smallint. Please help me solve this problem. Thanks a lot!!!