ILE C/C++ Programmer's Guide

Preparing to Create a Program

Before you create a program object using the CRTPGM command, you should:

  1. Establish a program name.
  2. Identify the module(s) and, if required, the service programs you want to bind into a program object.
  3. Make sure that the program has a program entry procedure that gets control when a dynamic program call is made. (That is, one module must contain the main() function of the program.)

    You indicate which module contains the program entry procedure through the ENTMOD parameter. The default is ENTMOD(*FIRST), which means that the module containing the first program entry procedure found in the list for the MODULE parameter is the entry module.

    If you are binding more than one ILE module together, you should specify ENTMOD(*FIRST) or else specify the module name with the program entry procedure. You can use ENTMOD(*ONLY) when you are binding only one module into a program object, or if you are binding several modules but only one contains a program entry procedure. For example, if you bind a module with a main() function to a C module without a main() function, you can specify ENTMOD(*ONLY).

  4. Identify the activation group that the program is to use.

    Specify ACTGRP(*NEW) if your program has no special requirements or if you are not sure which group to use.

    Note that ACTGRP(*NEW) is the default activation group for CRTPGM. This means that your program will run in its own activation group, and the activation group will terminate once the program terminates. This default ensures that your program has a refresh of the resources necessary to run, every time you call it.

    See Activating Groups for more information on unnamed and named activation groups.


[ Top of Page | Previous Page | Next Page | Table of Contents ]