What is happening in this " PIC" and without the "PIC"?

Cousins, Michael Michael.Cousins@Cognos.COM
Fri, 31 Mar 2000 18:27:17 -0500


See changes below

SET DIC DD011101.DOC.SCIPS
ACC B41301-COMMINDST
SET REP LIMIT 1000
DEFINE ACTUALGRM NUM*4 = ((ADJPRICE / AGI) * 100)
SORT ON GRM
REP SALEAPN ADJPRICE AGI GRM ACTUALGRM ACTUALGRM PIC " ^^.^^"   ; space in
front of first digit
SEL IF ACTUALGRM > 9999
GO

You are having the problem because NUM*4 implicitly defaults to a float size
4 datatype. Without a PIC clause on the output item the default PICTURE is
one space larger than the maximum number of digits allowed in the field - to
allow for the sign.
With a PIC that is too small (doesn't allow for the sign) the overflow
characters will display.

-----Original Message-----
From: Scott, Valerie [mailto:vscott@solanocounty.com]
Sent: Friday, March 31, 2000 6:16 PM
To: powerh-l@lists.swau.edu
Subject: What is happening in this " PIC" and without the "PIC"?


We have a item def as num*4, it is the receiver of the result of a
computation, and then should be displayed as a percent of that result.
we have tested it several ways as you will see below, but we are baffled by
the results:
-The resultant value in our example is larger than the defined size of the
item
-If we do not specify a pic in the Report statement, it will display the
value although because of no formatting, there is no way for the audience to
know it is a percent
-if we use a pic, then we get an overflow error
How can we display the value properly as "3.18"?

Thank you,

Valerie Scott
>SET DIC DD011101.DOC.SCIPS
> ACC B41301-COMMINDST
> SET REP LIMIT 1000
> DEFINE ACTUALGRM NUM*4 = ROUND ((ADJPRICE / AGI) * 100)
> SORT ON GRM
> REP SALEAPN ADJPRICE AGI GRM ACTUALGRM ACTUALGRM PIC "^^.^^"
> SEL IF ACTUALGRM > 9999
> GO

00/03/31 PAGE   1

  Parcel Number   Adjusted Price  Annual Gross  G.R.M.  ACTUALGRM  ACTUALGRM
                                     Income

   0089372250            760,000        2,389    3.18     31812      #####

Records selected:  1
Records sorted:    1
Lines printed:     4
Pages printed:     1

>SEL IF SALEAPN = "0113490070"
> GO

00/03/31 PAGE   1

  Parcel Number   Adjusted Price  Annual Gross  G.R.M.  ACTUALGRM  ACTUALGRM
                                     Income

   0113490070            820,400       63,760   12.86      1287      12.87
Records selected:  1
Records sorted:    1
Lines printed:     4
Pages printed:     1

> ACC *SDUPCOMM
> SHOW ITE

                                             INPUT OUTPUT
SDUPCOMM                                TYPE SCALE SCALE  DEC PICTURE
  IDSALE                                CHAR                  X(4)
  IDCHNGSAL                             CHAR                  X(4)
  DATECHNGSAL                           DATE                  YYYY/MM/DD
  SALEUSE                               NUM     0     0    0  ^^^^
  LOCATION                              CHAR                  X(30)
  SALERMRK1                             CHAR                  X(30)
  SALERMRK2                             CHAR                  X(30)
  SALERMRK3                             CHAR                  X(30)
  SALEREF                               CHAR                  X(12)
  NPISP                                 NUM     0     0    0  ^^^^
  RAWPRICE                              NUM     0     0    0
^^^,^^^,^^^,^^^
  ADJPRICE                              NUM     0     0    0
^^^,^^^,^^^,^^^
  SPSQBL                                NUM     0     0    0  ^,^^^.^^
  PROJECT                               CHAR                  X(30)
  AREAFRST                              NUM     0     0    0  ^^^,^^^
  AREASCND                              NUM     0     0    0  ^^^,^^^
  AREATHRD                              NUM     0     0    0  ^^^,^^^
  AREAOTHR                              NUM     0     0    0  ^^^,^^^
  AREABLDG                              NUM     0     0    0  ^^,^^^,^^^
  CONDITION                             CHAR                  X(2)
  YEARBLT                               NUM     0     0    0  ^^^^
  AGI                                   NUM     0     0    0  ^^,^^^,^^^
  RENTAL                                NUM     0     0    0  ^^.^^
  GRM                                   NUM     0     0    0  ^^.^^
  SALEBOOK                              CHAR                  X(4)
  SALEAPN                               CHAR                  X(10)
  DATESALE                              DATE                  MM/DD/YYYY
  ACTUALGRM                             NUM     0     0    0  ^^.^^


> SEL IF ACTUALGRM > 9999
> REP SALEAPN ADJPRICE AGI GRM ACTUALGRM
> GO

00/03/31            Solano County Integrated Property System           PAGE
1

  Parcel Number   Adjusted Price  Annual Gross  G.R.M.  ACTUALGRM
                                     Income

   0089372250            760,000        2,389    3.18     #####

Records selected:  1
Lines printed:     4
Pages printed:     1

>REP SALEAPN ADJPRICE AGI GRM ACTUALGRM ACTUALGRM PIC "^^^.^^" &
>    ACTUALGRM PIC "^^.^^"
> GO

00/03/31 
PAGE   1

  Parcel Number   Adjusted Price  Annual Gross  G.R.M.  ACTUALGRM  ACTUALGRM
                                     Income

  ACTUALGRM

   0089372250            760,000        2,389    3.18     #####     318.12
    #####

Records selected:  1
Lines printed:     6
Pages printed:     1

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.