CrazyEngineers
  • Picture Clauses in COBOL - Concept Explained

    Ankita Katdare

    Ankita Katdare

    @abrakadabra
    Updated: Oct 27, 2024
    Views: 1.1K
    Picture Clauses

    Every type of data must have a picture. This determines the type of data that it is.



    There is a distinction between the pictures that are used for input (or working storage) fields and those that are used for output fields. The ones used for output fields can be used to edit the output and do things like suppress leading zeroes or replace them by asterisks (for checks).

    Input or Working Storage Pictures

    X : Alpanumeric. Any character.
    A : Letter or Blank.
    9 : Digit
    V : Assumed decimal point
    S : Sign

    Output Pictures

    X, A, and 9 can be used here also.
    B -> Blank
    Z -> Zero suppression
    0 -> Zero insertion
    / -> Slash insertion eg. for a date.
    , -> Comma insertion (big numbers)
    . -> decimal point
    + -> forces a sign to appear
    - ->sign if negative
    CR -> Credit symbol
    DB -> Debit symbol
    * -> Asterisk instead of leading zeroes.
    $ ->Dollar sign
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register