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.
Joined: 06 Jun 2008 Posts: 8201 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.