IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubt in PIC , FIXED BIN INIT


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Senior Member


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

PostPosted: Tue Mar 20, 2007 5:41 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Doubt about pl/1 (job offer) General Talk & Fun Stuff 5
No new posts comparasion between BIN FIXED(63) an... PL/I & Assembler 10
Search our Forums:

Back to Top