By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

conversion of comp-1 to decimal format

P: n/a
hi all,

can anyone tell me how to convert a comp-1 floating point number to a
decimal in REXX??

Mar 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You will need to provide more information to get an answer. What
operating system are you on? What is the source of the comp-1 data? How
are you getting the data into your REXX variable?

If you are retrieving it using an sql statement, you could convert it to
decimal as part of the select. The DECIMAL function will convert any
numeric type to decimal and allows specifying precision and number of
digits in the conversion output. See the SQL Reference V1 for details.

Phil Sherman
kimi wrote:
hi all,

can anyone tell me how to convert a comp-1 floating point number to a
decimal in REXX??
Mar 7 '07 #2

P: n/a
On Mar 7, 8:02 pm, Phil Sherman <psher...@ameritech.netwrote:
You will need to provide more information to get an answer. What
operating system are you on? What is the source of the comp-1 data? How
are you getting the data into your REXX variable?

If you are retrieving it using an sql statement, you could convert it to
decimal as part of the select. The DECIMAL function will convert any
numeric type to decimal and allows specifying precision and number of
digits in the conversion output. See the SQL Reference V1 for details.

Phil Sherman

kimi wrote:
hi all,
can anyone tell me how to convert a comp-1 floating point number to a
decimal in REXX??- Hide quoted text -

- Show quoted text -
hi phil,
the operating system i am using is z/os....
the scenario is something like this.......

i have a sequential file which consists of comp-1 data
(floating point)...
as we know it would not be in a readable format in the
sequential file....
here arises the need to read this comp-1 data from the
sequential file , convert it to readable format and then display the
data.....
thanks phil waiting for ur reply!!!!!

Mar 8 '07 #3

P: n/a
This is a DB2 forum and not the best place to get an answer for this
question.

I know of four+ techniques to do this.
1. Write an assembler routine that will take the four byte comp-1 data
in as a passed parameter and place it directly in a REXX variable. If
you're running this in a TSO ISPF/PDF environment, you should be able to
use Cobol and ISPF variables to move the data in and out of the program.
2. Manually decode the value to a number using REXX. You'll need a copy
of the system architecture manual to get the exact bit layout of comp-1
to write a conversion routine.
3. Write a program in the language of your choice to read the file and
convert the comp-1 data to readable form. These are commonly called ETL
(Extract, Transform, Load) programs in the database environment.
4. Load the data to a DB2 table then use the REXX interface to DB2 to
read the data.

5. Hire me to figure out which technique is either best or feasible in
your environment and write the code for you.

Phil Sherman
kimi wrote:
On Mar 7, 8:02 pm, Phil Sherman <psher...@ameritech.netwrote:
>You will need to provide more information to get an answer. What
operating system are you on? What is the source of the comp-1 data? How
are you getting the data into your REXX variable?

If you are retrieving it using an sql statement, you could convert it to
decimal as part of the select. The DECIMAL function will convert any
numeric type to decimal and allows specifying precision and number of
digits in the conversion output. See the SQL Reference V1 for details.

Phil Sherman

kimi wrote:
>>hi all,
can anyone tell me how to convert a comp-1 floating point number to a
decimal in REXX??- Hide quoted text -
- Show quoted text -
hi phil,
the operating system i am using is z/os....
the scenario is something like this.......

i have a sequential file which consists of comp-1 data
(floating point)...
as we know it would not be in a readable format in the
sequential file....
here arises the need to read this comp-1 data from the
sequential file , convert it to readable format and then display the
data.....
thanks phil waiting for ur reply!!!!!
Mar 9 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.