473,379 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

conversion of comp-1 to decimal format

hi all,

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

Mar 7 '07 #1
3 6198
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Faheem Mitha | last post by:
Hi, I'm not sure what would be more appropriate, so I'm ccing it to both alt.comp.lang.learn.c-c++ and comp.lang.python, with followup to alt.comp.lang.learn.c-c++. While working with a...
16
by: Der Andere | last post by:
During every iteration in a loop, I need to convert a double value into a char*. Simple type-casting did not work, so I thought of using stringstreams. However, the stream would have to be...
3
by: Siemel Naran | last post by:
Here is a question about implicit conversion from T (&) to ptrcarray<T>. I wrote a class template <class T> struct ptrcarray { T * array; size_t size;
5
by: spoilsport | last post by:
Ive got to write a multi-function program and I'm plugging in the functions but I keep getting this error from line 40. Im new to this and cant find an answer anywhere. Sam #include...
2
by: dam_fool_2003 | last post by:
Just now I asked a question about signed char and unsigned char. I had the replay very fast by jens.torring and Tim prince. I post via google so now goes my thanking replay. (I must be more precise...
2
by: sriamar | last post by:
Hello, How does the type conversion work if the expression involves a float and long int? By K&R 2nd Ed i assume float & long -> float & float . But does the 'long' qualifier affect this...
22
by: junky_fellow | last post by:
Consider a function: void *test_func(void) { return ((void *)-1); } While returning, the integer -1 is converted to void *. Is this portable ?
2
by: vishnu | last post by:
Hi all I have a code written in C++ which is working fine for my project. Due to some other reasons I need the same which should be in shell script. So, instead of going for rewriting in the...
1
by: v4vijayakumar | last post by:
Can "c++ conversion operator" be considered as an example for Prototype design pattern? Following example explains, C++ conversion operator. #include <iostream> #include <string> using...
19
by: =?iso-8859-1?b?VG9t4XMg0yBoyWlsaWRoZQ==?= | last post by:
Coming originally from C++, I used to do the likes of the following, using a pointer in a conditional: void Func(int *p) { if (p) { *p++ = 7; *p++ = 8;
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.