Skip to Content
author's profile photo
Former Member

what is size of PACKED FILED

what is size of PACKED FILED?

please explain

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 10:20 AM

    Hi,

    max length is 16 and max number of decimals is 14.

    data:pac(16) type p decimals 14 value '1234'.

    write:/ pac.

    <b>reward if helpful</b>

    rgds,

    bharat.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 10:20 AM

    Hello,

    The value range of type <b>P</b> fields depends on their length and the number of decimal places. P fields can be <b>1 to 16</b> bytes long, with two decimal digits packed into each byte, and one decimal digit and the sign packed into the last byte. There can be up to <b>14</b> decimal places. Auxiliary fields for intermediate results are always <b>16 bytes</b> long and can thus hold up to 31 decimal digits. To ensure that the decimal point is correctly calculated, you should always set the program attribute "fixed point arithmetic". Otherwise, all numbers are specified as integers and all intermediate results for the next integer are rounded. If "fixed point arithmetic" is not set, the decimal places defined for the number only appear when outputting with WRITE.

    Fixed point arithmetic is decimal arithmetic and is similar to using a pocket calculator or calculating with paper and pencil.

    Type <b>P</b> is typically used for sizes, lengths, weights and sums of money.

    Reward if helpful,

    Regards,

    LIJO

    Add comment
    10|10000 characters needed characters exceeded