View previous topic :: View next topic
|
Author |
Message |
chandracdac
New User
Joined: 15 Jun 2007 Posts: 92 Location: bangalore
|
|
|
|
Hi..
I have redefined x(30) with 9(08). I will get the value in this x(30) from one of my field from table .Some times i may get the result from the table with length 7 also. Since i have redefined this with 9(08) it is adding zero at the end and my calculations are going wrong. For example if the value from my table is 12345678 then i will be able to use the same value in my calculations instead if the value from table is 1234567 then it is giving 12345670 when i use the redefined variable.. What shloud i do for rectifying this problem.
Thanks in advance... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Do you know when there's 7 and when there's 8 digits? If so, use another REDEFINES with a 7-byte variable. If not, check the 8th byte of the X(30) variable to be a space (assuming that's what it will be when the variable is only 7 bytes long) and handle the value appropriately. |
|
Back to top |
|
|
chandracdac
New User
Joined: 15 Jun 2007 Posts: 92 Location: bangalore
|
|
|
|
Hi...
i don't know when i will get 7 chars and when 8 chars. that space checking was good idea.. will try that and let the people know abt that
Thanks |
|
Back to top |
|
|
|