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
 
Doubt in PIC , FIXED BIN INIT

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

New User


Joined: 27 Oct 2006
Posts: 17

PostPosted: Tue Mar 20, 2007 5:33 pm    Post subject: Doubt in PIC , FIXED BIN INIT
Reply with quote

Hi,

Can any1 update me on this.

I have a two declaration part..

DCL A FIXED BIN INIT(45065838);
DCL B PIC'999V99999';

The logic is :

B=A;

i'm getting this output : 838.00000

But my output should be "450.65838"

Thanks in advance,
Thenmozhi
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Tue Mar 20, 2007 5:41 pm    Post subject:
Reply with quote

A = 45065838 with no fraction, so rightmost 3 digits = 838, with no fractional part. B has room for only 3 digits to the left of the decpt, hence the code is truncating your source value on the left and giving you 838.00000, just as the PIC says.

Why are you moving a very large integer value into a field that takes a max value of 999.99999?

COBOL does this too - truncates on the left if the target field is too small. It is the programmer's resp to check for this.
Back to top
View user's profile Send private message
HONEY LANGUAGE
Warnings : 2

New User


Joined: 27 Oct 2006
Posts: 17

PostPosted: Tue Mar 20, 2007 6:04 pm    Post subject: Re: Doubt in PIC...
Reply with quote

Hi Phil,

Just like that i'm testing it and thanks for your reply.

Thanks,
Thenmozhi icon_smile.gif
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 Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Released Init 0 Yolanda Harvey All Other Mainframe Topics 13 Thu Aug 11, 2016 8:51 pm
No new posts How to copy data with delimters to fi... Venkata Ramayya DFSORT/ICETOOL 2 Wed Feb 24, 2016 10:03 pm
No new posts FIXED BIN (31) and FIXED BIN (63) - H... sundarkudos PL/I & Assembler 4 Thu Nov 05, 2015 1:11 pm

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