Sign in

docs RPG Reference

Conditions Relating to the Command Being Used

Conditions Relating to the Command Being Used

*CRTBNDRPG : This condition is defined if your program is being compiled by the CRTBNDRPG command, which creates a program.

```rpgle
      /IF DEFINED(*CRTBNDRPG)
     H DFTACTGRP(*NO)
      /ENDIF
```

*CRTRPGMOD : This condition is defined if your program is being compiled by the CRTRPGMOD command, which creates a module.

```rpgle
      * This code might appear in a generic Control specification
      * contained in a /COPY file.  The module that contains the
      * main procedure would define condition THIS_IS_MAIN before
      * coding the /COPY directive.

      * If the CRTRPGMOD command is not being used, or if
      * THIS_IS_MAIN is defined, the NOMAIN keyword will not
      * be used in this Control specification.

      /IF DEFINED(*CRTRPGMOD)
      /IF NOT DEFINED(THIS_IS_MAIN)
     H NOMAIN
      /ENDIF
      /ENDIF
```