Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert COMP decimal field into normal field

Status
Not open for further replies.

shaily123

Programmer
Feb 5, 2005
17
US
I have a field

01 sale 9(4)v9(5) comp.

I need to move this to a 9(7) field.

value in sale field is always 0012.34567 or 0098.76543 any number starts with two zero and then number.

can any one help.

I did it with replace like below

01 sale 9(4)v9(5) comp
replacing 9(4)v9(5) == 9(9).


then it is showing in the file like

01 sale 9(9) comp.

but it is not displaying the data. IS it working only screen not internal format or what??

any help...
 
Something like this ?
01 sale pic 9(4)v9(5) comp.
01 buffer.
03 sale-dec pic 99v9(5).
03 sale-int redefines sale-dec pic 9(7).

move sale to sale-dec
display sale-int

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Did you want the decimal to still be there?
If so, you could:

01 sale 9(4)v9(5) comp.
01 sale_moved pic ---9.99999.


So 0012.34567 would look like 12.34567.




 
COMP is binary in my system.

If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top