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: 1771
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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm


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