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
 
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: 1777
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 question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am

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