Purpose
The PROGRAM statement specifies that a program unit is a main program, the program unit that receives control from the system when the executable program is invoked at run time.
Format
>>-PROGRAM--name----------------------------------------------->< |
Rules
The PROGRAM statement is optional.
If specified, the PROGRAM statement must be the first statement of the main program.
If a program name is specified in the corresponding END statement, it must match name.
The program name is global to the executable program. This name must not be the same as the name of any common block, external procedure, or any other program unit in that executable program, or as any name that is local to the main program.
The name has no type, and it must not appear in any type declaration or specification statements. You cannot refer to a main program from a subprogram or from itself.
PROGRAM DISPLAY_NUMBER_2 INTEGER A A = 2 PRINT *, A END PROGRAM DISPLAY_NUMBER_2
Related Information