[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNU-COBOL] PIC





>>> "David L. Nicol" <david@kasey.umkc.edu> 10/26/99 07:07PM >>>
Randall Bart wrote:

-RB
> The most tedious of all items of COBOL grammar is PICTURE.

-DN
I'm getting out of this that PIC is short for PICTURE,
and that PICTURE is a language for defining record structure
of packed data. 

Someone enumerated a few PIC primitives, possibly all
of them.  Do vendors add vendor-specific letters to PIC
syntax?

-BK
PIC is not a language, its just a clause element to tell the compiler what to do with the following character string.  For instance a record (table row? column headings?) would be described like this: (Note this is easier to read in fixed pitch font)

01  ADDRESS-BOOK.
    03  ADDRESS-KEY-0.
        05  LAST-NAME          PIC  X(30).
        05  FIRST-NAME         PIC  X(20).
        05  MIDDLE-NAME          PIC X(20).
    03  TELEPHONE-NUMBER.
        05  COUNTRY-CODE      PIC  9(03).
        05  AREA-CODE              PIC  9(04).
        05  EXCHANGE               PIC 9(04).
        05  NUMBER                   PIC 9(05).
    03  MONEY-OWED           PIC S9(05)V9(02).

This describes a storage are with the following:
ADDRESS-BOOK is a string of 86 characters.
ADDRESS-KEY-0 is a string of 70 characters.
LAST-NAME is a string of 30 characters.
FIRST-NAME is a string of 20 characters
MIDDLE-NAME is a string of 20 characters.
TELEPHONE-NUMBER is a string of 16 characters.
COUNTRY-CODE is an integer of 3 digits.
AREA-CODE is an integer of 4 digits
EXCHANGE is an integer of 4 digits
NUMBER is an integer string of 5 digits
MONEY-OWED is a signed integer string of 7 digits with the last two digits to be aligned to the right of any decimal point (for comparisons, moves, &c).


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.