Posted: Thu Feb 21, 2008 4:05 pm Post subject: Need to convert PD length from Decimal(4,0) to Decimal(6,2)

I have a DB2 column defined as Decimal(4,0) and is getting changed to Decimal(6,2). I have a file with old column length in a flatfile in PD format. I have to create a load file by converting this field to the new length(decimal 6,2) which is also in PD format.

Do we have any sample to convert a PD format field length as required to include decimal positions ?

Posted: Thu Feb 21, 2008 6:48 pm Post subject: Need to convert PD length from Decimal(4,0) to Decimal(11,2)

Thanks for the quick response.
But I understand that this sample you have given will not harm the integer part even it is getting multiplied with +100 as Decimal(4,0) and Decimal(6,2) will have integer part as S9(4) (execluding decimal part) ..
Ex: 1234 in decimal(4,0)
after the jcl ... it will be 123400 which will get mapped as 1234.00 for decimal(6,0)

I guess this approach creates problem if the destination field is having length decimal(11,2).

Let me know how can we acheive this.
Correct me if my understanding is wrong.

Joined: 25 Jun 2007 Posts: 196 Location: Bangalore

Posted: Thu Feb 21, 2008 7:51 pm Post subject:

Hi gotlamitla,

Quote:

I guess this approach creates problem if the destination field is having length decimal(11,2).

Modify the before posted code as per the column datatype and length.
Let us assume the DB2 column defined as Decimal(4,0) changed to Decimal(11,2), then we have to modify the before posted code as below to get the new load file.