https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120715

            Bug ID: 120715
           Summary: FR: add COBOL2023 EDITING phrase to PICTURE clause
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simonsobisch at gnu dot org
  Target Milestone: ---

This may be postponed as I'm not aware of a compiler supporting that, but as
the target is COBOL 2023 and it looks easy to add, at least on the parsing side
and can be warned + internally replaced by a leading - and still "run
correctly" if the runtime does not support is...


program-id. cx.
   data division.
   working-storage section.
   77 var            pic s999v999 VALUE -12.5.
   77 var2           pic LLL9v999F
       EDITING CHARACTER "L" FOR NEGATIVE IS "("
       EDITING CHARACTER "F" FOR NEGATIVE IS ")"
       BLANK WHEN ZERO.
                                  .

   procedure division.
       move var to var2
       display var2
       move zero to var2
       display var2
       move 1234 to var2
       display var2

       goback  .


Result:

 (12.500)

 234.000

Reply via email to