PL/I decimal scaling factor



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

PL/I decimal scaling factor

Postby Joyce » Sat Jan 12, 2008 1:27 am

I need a concise definition/explanation of the PL/I decimal scaling factor. My Google searches so far haven't been fruitful. Any recommendations? Thanks.
Joyce
 
Posts: 1
Joined: Sat Jan 12, 2008 1:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: PL/I decimal scaling factor

Postby whale » Mon Jan 21, 2008 3:54 pm

Fixed decimal is nothing but it is packed decimal .
Type of data = coded arithmetic
Default Precision = 5 decimal digits
Maximum Precision = 15 decimal digits

It is very usefull when calculation has to be done.
It is more efficient to declare the precision of fixed decimal data as an odd number.

The no of bytes required to store tha data is = (n+1)/2
Regards ,
whale
_______________________________________
Self-confidence, hard work can ensure success
whale
 
Posts: 8
Joined: Mon Dec 17, 2007 8:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: PL/I decimal scaling factor

Postby whale » Mon Jan 21, 2008 4:39 pm

This also helps .

FIXED DEC(5,2) takes
5*(1/2 byte) + 1/2 byte for sign = 3 bytes

FIXED DEC(4,2) or FIXED DEC(4,0) (as is the case here).

4*(1/2 byte) + 1/2 byte for sign = 2 and half bytes. But the remaining 1/2 byte is wasted. So it too occupies 3 bytes.


FIXED DEC in PL1 is equal to COMP-3 in Cobol

eg: FIXED DEC(5,1) = 9(4)v9(1) comp-3
Regards ,
whale
_______________________________________
Self-confidence, hard work can ensure success
whale
 
Posts: 8
Joined: Mon Dec 17, 2007 8:19 pm
Has thanked: 0 time
Been thanked: 0 time


Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post