Operating System - OpenVMS
1827810 Members
1942 Online
109969 Solutions
New Discussion

Converting D_Floating(COMP-2) data to readable format data

 
sureshso
Occasional Contributor

Converting D_Floating(COMP-2) data to readable format data

Hi,

i have D_floating (COMP-2) variables in my index files. when i try to read index file these columns data in hexa decimal format and unreadable format.

i am writing COBOL program to move these D_floating columns data to readable data type columns and tring to write in to sequential file for reading that data.

Please help me how can we convert to D_Floating columns data(COMP-2) to readable format data types (interger 9 or text X). what will be declaration for readable format data types (picture clause)?  

1 REPLY 1
Hein van den Heuvel
Honored Contributor

Re: Converting D_Floating(COMP-2) data to readable format data

Just MOVE in COBOL for example to a  PIC 999999.99 field for dollars and cents.

The Cobol RTL will do the work.

You can also explcitily call conversion functions like OTS$CNVOUT (HP OpenVMS RTL General Purpose(OTS$) Manual)

Hope this helps,

Hein