load integer data

SUBSCRIBE DB2-L Anil Kale

load integer data
Hi All !

This question is in the context of DB2 for z/os V9.

Task: Execute IBM's LOAD util
Table to be loaded: Test_Table01
Columns in Test_Table01: COL1 INTEGER NOT NULL (for simplicity, just consider a one column table)
Data to be loaded (SYSREC): Numbers from 900000000 to 900000100. The numbers are in position 1 thru 9. In effect, its character format.
Therefore, if you cannot use
LOAD REPLACE INTO TABLE Test_Table01 (COL1 POSITION(1) INTEGER )
neither can you use your creativity to specify
LOAD REPLACE INTO TABLE Test_Table01 (COL1 POSITION(1:9) INTEGER )

A crude way of doing it is that I can create Test_Table02 with COL1 CHAR(9) NOT NULL

then,
LOAD REPLACE INTO TABLE Test_Table02 (COL1 POSITION(1:9) CHAR(9))
followed by
INSERT INTO Test_Table01 SELECT INT(COL1) FROM Test_Table02;

Question:
Is there a way to specify the format conversion in the load control card ?

Thanks.

Anil



_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Wayne Stevens

Re: load integer data
(in response to SUBSCRIBE DB2-L Anil Kale)
You could do a LOAD REPLACE INTO TABLE Test_Table01 (COL1 POSITION(1:9) INTEGER EXTERNAL)


________________________________________
From: IDUG DB2-L [[login to unmask email] On Behalf Of Anil [[login to unmask email]
Sent: Wednesday, November 24, 2010 11:55 PM
To: [login to unmask email]
Subject: [DB2-L] load integer data

Hi All !

This question is in the context of DB2 for z/os V9.

Task: Execute IBM's LOAD util
Table to be loaded: Test_Table01
Columns in Test_Table01: COL1 INTEGER NOT NULL (for simplicity, just consider a one column table)
Data to be loaded (SYSREC): Numbers from 900000000 to 900000100. The numbers are in position 1 thru 9. In effect, its character format.
Therefore, if you cannot use
LOAD REPLACE INTO TABLE Test_Table01 (COL1 POSITION(1) INTEGER )
neither can you use your creativity to specify
LOAD REPLACE INTO TABLE Test_Table01 (COL1 POSITION(1:9) INTEGER )

A crude way of doing it is that I can create Test_Table02 with COL1 CHAR(9) NOT NULL

then,
LOAD REPLACE INTO TABLE Test_Table02 (COL1 POSITION(1:9) CHAR(9))
followed by
INSERT INTO Test_Table01 SELECT INT(COL1) FROM Test_Table02;

Question:
Is there a way to specify the format conversion in the load control card ?

Thanks.

Anil



_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv
_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv