View previous topic :: View next topic
|
Author |
Message |
sp_vas
New User
Joined: 03 Mar 2006 Posts: 2
|
|
|
|
Hi,
data1 pic 9(4).
data2 pic x(2)
Need help, i need to convert all numeric data from data1 > 99 into data2.
Data2 can be alpha numeric also.
plz help me.
Thanks,
Vas |
|
Back to top |
|
|
KS
New User
Joined: 28 Feb 2006 Posts: 91 Location: Chennai
|
|
|
|
Hi,
The above is not possible.
Could you please explain the requirement more clearly?
Thanks,
KS |
|
Back to top |
|
|
sp_vas
New User
Joined: 03 Mar 2006 Posts: 2
|
|
|
|
Hi KS,
directly its may not be possible,... but requirement is that i have a data1 field which is 4 bytes aand was getting mapped to 2 bytes..
wherein we were always getting 0-99 nos but suddenly we r expected to get 0-999 numbers so when it gets mapped to 2 bytes we will be loosing all values more than 99...
so i need to develop an algorithm .. ex something like convering into dexa decimal and then again decoding..
exp 100 can be mapped as AA or XX or HF etc and decode again.
Thanks,
Vas |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
hy buddy,
define your pic 9(04) usage display to pic s9(04) usage binary,
then the field is only 2 bytes long and fits into pic x(02).
how you identify, if this value is more than 100, for this
you must do your own logic...
martin9 |
|
Back to top |
|
|
|