DECFLOAT – Internal Format

20 pts.
Tags:
DB2
DB2 9
DB2 administration
DECFLOAT
z/OS
Hello,

How to translate an internal DECFLOAT value into a visual format? DB2 Administration Guide: "Convert and return a DECFLOAT representation of a number or string representation of a number", (Appendix A. Writing exit routines).

There is an example there:

Internal Format              DFP Format                String Representation

D8F77D00000000000C    222C000000001E80     +7.500  

 

They do not explain, how to convert. Can anybody help, please? Thanks

 



Software/Hardware used:
Assembler
ASKED: November 15, 2009  2:47 PM
UPDATED: February 1, 2010  4:55 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello,

I am not sure what you mean by “visual format.”

I will take a guess that you want a floating point number to be returned to your application as a decimal number. Use the DECIMAL function.

For example:

CREATE TABLE TTEST (F_COL FLOAT);
———+———+———+———+———+———+—–
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0

INSERT INTO TTEST VALUES (7.500);
———+———+———+———+———+———+—–
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
SELECT F_COL , DEC(F_COL,5,3)
FROM TTEST;
———+———+———+———+———+———+—–
F_COL
———+———+———+———+———+———+—–
+0.7500000000000000E+01 7.500
DSNE610I NUMBER OF ROWS DISPLAYED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100

DROP TABLE TTEST;

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Eligin
    Hello Meandyou, I have to transfer a DB2 decimal floating point value (in Sortable Decimal Format) to a character string, for example, X'D8F77D00000000000C' to C'7.5' (or to a regular DFP number, X'222C000000001E80' ) in an Assembler program (z/OS).
    20 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following