Program part
A program part defines the central logic in a runtime program.
Program parts have the following characteristics:
- Each Program part has a single entry point. That entry point is
the required
main()function, which represents the logic that runs at program startup and invokes other functions. - A Program can also include other functions and can access functions that are outside of the Program part.
- Program parts use stereotypes to specialize code for user interfaces. The BasicProgram is the only stereotype that is part of the core EGL package. A basic program can access databases or files, perform calculations, and use most of the EGL statements. However, a basic program cannot communicate with the user through a browser, 3270 screen, or other interface. Some UI technologies offer additional stereotypes. See the related reference links at the end of this topic for the technologies that you might be using.
- Many properties are available at the Program level that affect code behavior. For more information, see Program properties.
- You can define either main programs (defined without parameters) or called programs (defined with parameters). For more information, see Main versus called programs.
For more information about Program parts, see Introduction to Program parts.
Syntax

- programName
- The name you assigned to this program.
- parameter
- You can pass parameters, but only to called programs. For more information, see Main versus called programs.
- statement
- Any EGL statement.
Compatibility
| Platform | Issue |
|---|---|
| z/OS® | The maximum length of a generated program name is 8 characters. |
| iSeries® COBOL | The name of a generated program has the following
maximum lengths:
|