Posted: Thu Dec 02, 2004 5:57 am Post subject: DB2 Conversion (Integer)
Hi,
We try to load data from a text file onto a DB2 database. In this specific case the data we load is identified as INTEGER on DB2, but in the text file we have 10 digits / characters.
Is there a routine to load these digits into a DB2 column with INTEGER format? We understand that the an INTEGER can hold up to 10 digits, but whenever we try to load the data, the result we see in DB2 is not what we had in the text file. We also understand that there is some compression going on, but we do not know when and where.
Could you please let us know, if there is any routine for loading such data?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Dec 02, 2004 8:24 am Post subject:
Monaco,
You can run the text file thru a sort to convert the numeric into integer format.
An integer in DB2 is equivalent to S9(9) Comp in cobol. It is Binary full-word (4 bytes) and can be used to stroe values -2,147,483,648 through +2,147,483,647
For example if your input has the 10 digit number at pos 5 then you can use the following job to convert them to integer format
Posted: Wed Jan 05, 2005 6:49 am Post subject: Query reqarding the solution provided?
I could not understand certain things in the solution provided below.
They are as follows :
1) Can you pls explain the step :
OUTREC FIELDS=(1,4,5,11,FS,FI,LENGTH=4)
I could not understand the conversion and what is meant by 1,4,5,11?
And 'FS','FI' ,'ZD' and length = 4.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum