Floating Comment Indicator Example


Info! Inline comments are introduced by COBOL V5.1 and supported from v5.1. Previous versions (before COBOL V5.1) do not support inline comments.

Scenario - Explaining the floating comment coding in COBOL program.

Code -

----+----1----+----2----+----3----+----4----+----5----+
       IDENTIFICATION DIVISION.
       PROGRAM-ID. FLOATCOM.
       AUTHOR. MTH.
 
       PROCEDURE DIVISION.

        *> INLINE COMMENT IN AREA-A

           DISPLAY "INLINE COMMENT". *> INLINE COMMENT IN AREA-B
           STOP RUN.

Explaining Example -

In the above example:

  • INLINE COMMENT IN AREA-A - Specifies the floating comment coded in Area A.
  • INLINE COMMENT IN AREA-B - Specifies the floating comment coded in Area B.
Info! Floating comment should always start with *>.