View previous topic :: View next topic
|
Author |
Message |
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Hi Forum,
How do I convert float (in table structure) and COMP-2 USAGE DISPLAY (in DCLGEN copybook) to a displayable format?
The issue comes when I try to string this float variable with the current definition of COMP-2 to write to a file.
Pleasea advise. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I believe that the SQL CHAR function will give you a 24-byte right-padded string representation of a float expression, and a 42-byte right-padded string representation of a decimal float expression. |
|
Back to top |
|
|
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Hi,
Using the CAST function in the SQL that I write within the program resolved this. I CAST-ed the float into a CHAR(13) field and it works fine.
Sample is
Code: |
Select
CAST(var_1 AS char(13))
from Table A |
Where Var_1 is defined as a floating point variable.
ps. I think the number of characters that should contain these values should be 53, but I am saving space lookin at the data. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear you have this working - thank you for lettng us know
d |
|
Back to top |
|
|
|