View previous topic :: View next topic
|
Author |
Message |
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi all
I have a problem with my map field.
One of my map field has to accept decimal data for a db2 table having datatype dec(7,2). The same field is to used for displaying the data from the db2 table with decimal point. I have used PICIN and PICOUT. But while compiling map, it gives length mismatch for that field. What is the solution to rectify it.
Please someone help me...
Thanks in advance
Raghunathan |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
please show the BMS DFHMDF map definition and the error message |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Earl
Thanks for the response.
The DFHMDF is as follows. It may have some alignment problem here, but not in PDS.
DFHMDF POS=(13,01),LENGTH=13,ATTRB=PROT, *
INITIAL='Opening Amt :'
OPNAMT DFHMDF POS=(13,15),LENGTH=7,PICIN='99999V99', *
PICOUT='99999.99',ATTRB=UNPROT
While Assembling there is no alignment problem. But the error due to the
length=7 parameter. The length does not satisfy the PICIN and PICOUT.
Please suggest a solution. I want to display the field with decimal point when sending the map.
Thanks
Raghu |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Let's see ... 5 nines, a period, 2 nines ... adds up to 8 characters to me. Change your map to allow for 8 characters in the field. |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Robert
I changed to length=8, then I got error PICIN is 7 in length
RaGHU |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Uh, if you change the length you'll need to change the PICIN, won't you? |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Robert
If I change the length of PICIN, which part( integer part or decimal part?)
I would increase?
Thanks
Raghu |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
You need to increase the integer part, because otherwise you've got a decimal alignment problem. However, your larger problem that you need to think about is that the PICIN and PICOUT don't match -- you're going to have to do some manipulation in your program to get the pictures matching at some point. |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Robert
If I increase the integer part by 1 position, the length mismatch problem is over. But when entering value in this field there is another problem. For example I entered 12345678. The value stored is 23456.78. That became a big mistake. If the length is increased in decimal part and if
I am entering 12345678, the value stored is 12345.67. The last digit will be truncated. So I have to give instruction to the user, how to enter data in this field. Is there any way to avoid this problem?
Anyway thanks for your advise.
Regards
Raghunathan |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Possibility 1: make it 8 alpha characters and use BIF DEEDIT on the input to remove non-numeric characters. Let the user enter a decimal point if they want.
Possibility 2: document with many examples exactly how the users are to enter data and show the output they will get.
Possibility 3: separate the integer and decimal parts into two fields and have them entered separately. This may require an extra "tab" by the user should they not fill the enter integer field.
This is one of those cases where you select an option based on the application, screen space available, and desired business results and go with it. Personally, I wouldn't want to be truncating the left digit of an integer, though, since you lose significance by doing so. |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Robert
I used this technique( BIF DEEDIT ) and the problem is solved. User can enter data with decimal point.
Thanks for your kind support.
Regards
Raghu |
|
Back to top |
|
|
|