IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

converting '36000C'x


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 27, 2018 4:14 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Jun 27, 2018 4:31 am
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jun 27, 2018 12:30 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jun 28, 2018 3:48 am
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Jun 28, 2018 3:38 pm
Reply with quote

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.

Code:
pic 'zzz9.v9'

The decimal point is just an insertion character. The 'v' is the location of the (implied) decimal point. Use
Code:
pic '9v.9999999'
to print the same as 3.6000000
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Converting S9(18) value to a decimal ... DFSORT/ICETOOL 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
Search our Forums:

Back to Top