Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question on storing binary number to char

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

New User


Joined: 08 Feb 2009
Posts: 67
Location: hz

PostPosted: Fri Apr 22, 2011 10:23 am    Post subject: Question on storing binary number to char
Reply with quote

I tried to store binary number into char, it shows 63 in hex
Code:
DCL BIN_E FIXED BIN(7) INIT(99);
DCL P5_E CHAR(1) BASED(ADDR(BIN_E));


however, when I change the below, it shows 00 in hex, why it failed? I am confused.
Code:
DCL BIN_E FIXED BIN(8) INIT(99);
DCL P5_E CHAR(1) BASED(ADDR(BIN_E));
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


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

PostPosted: Fri Apr 22, 2011 3:08 pm    Post subject:
Reply with quote

A FIXED BIN (7) can occupy one byte; a FIXED BIN (8) must occupy two (SIGNED is implied). P5_E is defined on the first byte of BIN_E. In your first example, the internal representation of 99 is 63; in the second, it's 0063...and P5_E is defined on the 00, which you are seeing.
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us