Skip to main content

COBOL : Using Conditional Compilation in Enterprise COBOL Dialect

  • December 7, 2021
  • 0 replies
  • 0 views

Heather Caldwell

Environment

Enterprise Developer / Enterprise COBOL

 

Problem

Compiler error 1078.

 

Cause

If you use code such as:

      $if p64 set
           display "64BIT"
      $else
           display "32BIT"
      $end 


Then you will get a compiler error 1078 returned.
 

Resolution

You can use the FLAGAS"I" to switch the dialect errors to Informational so that code generation still of occurs. Also the CHANGE-MESSAGE(1078 N) can be used to suppress the message.

The ISO2002 COBOL Standard introduced a new conditional compilation syntax using ">>" and this is also included in Enterprise COBOL dialect. Full article: https://portal.microfocus.com/s/article/KM000002829

 

...
   >>DEFINE 64BIT AS PARAMETER
...
   >>IF 64BIT IS DEFINED
       CALL "INIT64"
   >>ELSE
       CALL "INIT32"
   >>END-IF
...


Full article: https://portal.microfocus.com/s/article/KM000002829

#SupportTips/KnowledgeDocs
#EnterpriseDeveloper

0 replies

Be the first to reply!