On each image, a segment is the sequence of statements executed before the first execution of an image control statement, between the execution of two image control statements, or after the last execution of an image control statement.
The segment executed immediately before the execution of an image control statement includes the evaluation of all expressions within that image control statement.
A main program is a program unit whose first statement is not a SUBROUTINE, FUNCTION, MODULE, or BLOCK DATA statement. Program execution always begins with the first executable statement in the main program, so there must be exactly one main program unit in every executable program. For more information, see PROGRAM.