Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Assigning the compilation unit with the END statement

The input of compilation units and control statements can also be achieved without using the ASSIGN-SYSDTA command. After invocation, the compiler expects input from the terminal via SYSDTA. When the asterisk appears in the first column, the user can enter source code or compiler options. All entered characters that do not represent a valid COMOPT control statement are interpreted as source code by the compiler.
The END statement can be used to assign a cataloged file or a library element. If a file or library element is specified with it, the END statement can also be the first statement to be issued after the compiler is called. Further COMOPT statements may be included at the start of the assigned file.

If the END statement is used to assign a library element, the name of the compilation unit cannot be correctly mapped in the compiler listings and at the AID-FE interface.

If the END statement is used to assign a file, this file must be “SYSDTA-compatible” i.e. an ASSIGN-SYSDTA command must run without errors for this file.

Example 4-1

Assigning a cataloged file after input of COMOPT statements

/START-PROGRAM $COBOL2000————————————————————————————(1)
COMOPT...————————————————————————————————————————————(2) 
END SOURCE.MULTABLE——————————————————————————————————(3)

(1)

The compiler is invoked. In interactive mode SYSDTA is assigned to the terminal.

(2)

The keyword COMOPT informs the compiler that the following entries are control statements.

(3)

The END statement assigns SYSDTA to the cataloged file SOURCE.MULTABLE, which contains the compilation unit to be compiled or a sequence of control statements.
At the end of compilation SYSDTA and SYSCMD are linked together.

Example 4-2

Assigning a library without the use of COMOPT statements

/START-PROGRAM $COBOL2000————————————————————————————(1)
END PLAM.LIB(EXAMP3)—————————————————————————————————(2)

(1)

Invocation of the compiler; in interactive mode SYSDTA is assigned to the terminal.

(2)

The system file SYSDTA is assigned to the element EXAMP3 in the PLAM library PLAM.LIB. At the end of the compilation SYSDTA and SYSCMD are linked together.