View previous topic :: View next topic
|
Author |
Message |
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I used a macro to specify a value of 3600. Then later used a DB2 service and got back a control block with that field (and related information).
My original value of 3600 is saved as '36000C'x in the control block. I am not familiar with this format. How to convert this hex value to a displayable value? in PLI. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
It appears to have been saved as a signed fixed decimal value with an implied scale of one. Use s PUT EDIT variable (F (5,1)) in the PL/I program. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
The field as descbibed would be declared as :
DCL DEC_VALUE DEC FIXED(5);
the printable field as :
DCL PRT_VALUE PIC'(5)9';
assign to printable :
PRT VALUE = DEC_VALUE;
then you can print the PRT_VALUE or write to dataset etc etc..
Garry, |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I misunderstood my data. the '36000C'x is actually 3600.0
I am not familiar with the nuances of PIC. I am trying to figure out how to get the decimal point to come out. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Pedro wrote: |
I misunderstood my data. the '36000C'x is actually 3600.0
I am not familiar with the nuances of PIC. I am trying to figure out how to get the decimal point to come out. |
The decimal point is just an insertion character. The 'v' is the location of the (implied) decimal point. Use
to print the same as 3.6000000 |
|
Back to top |
|
|
|