Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
converting '36000C'x

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Pedro

Senior Member


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

PostPosted: Wed Jun 27, 2018 4:14 am    Post subject: converting '36000C'x
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: 1789
Location: Bloomington, IL

PostPosted: Wed Jun 27, 2018 4:31 am    Post subject:
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: 1018
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jun 27, 2018 12:30 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Jun 28, 2018 3:48 am    Post subject: Reply to: converting '36000C'x
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: 1117
Location: Oostende, Belgium

PostPosted: Thu Jun 28, 2018 3:38 pm    Post subject: Re: Reply to: converting '36000C'x
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting SAS code to Cobol or Easyt... Ashish.Raghav All Other Mainframe Topics 6 Fri Jun 29, 2018 6:01 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us