Friday, 12 December 2008

CONFIGURATION SECTION:

This section contains an overall specification of the computer used for the purpose of compilation and execution of the program. There are in all three paragraphs in this section.

SOURCE-COMPUTER:

This paragraph specifies the name of the computer used to compile the COBOL program.

The following is the form of this paragraph.

SOURCE-COMPUTER. Computer-name.

Ex:-

SOURCE-COMPUTER. ICL-1901.

OBJECT-COMPUTER:

The OBJECT-COMPUTER paragraph describes the computer on which the program is to be executed.

The following shows the syntax for this paragraph.

OBJECT-COMPUTER. Computer-name

[, MEMORY SIZE integer-1 CHARACTERS ]

WORDS

[, PROGRAM COLLALTING SEQUENCE IS alphabet-name]

[, SEGMENT-LIMT IS integer-2].

The computer name specifies a particular computer on which the object program is to be executed.

The MEMORY SIZE is used to indicate the amount of storage available to the object program.

The PROGRAM COLLATING SEQUENCE clause specifies the collating sequence that is to be used to compare non-numeric data items.

The SEGMENT-LIMIT clause is used in most of the compilers to indicate that the sections having segment number less than the number specified in integer-2.

Ex:-

OBJECT-COMPUTER. ICL-1900

MEMORY SIZE 8000 WORDS.

SPECIAL-NAMES:

This paragraph is used to relate some hardware names to user-specified mnemonic names. This paragraph is optional in all compilers. The following is the format of this paragraph.

SPECIAL-NAMES. [, CURRENCY SIGN IS literal-1]

[, DECIMAL-POINT IS COMMA]

[, CHANNEL. Integer IS mnemonic-names]…

[, alphabet ALPHABET-NAME IS STANDARD-1

NATIVE ] …

Implementor-name

[, implementor-name IS mnemonic-name].

The CHANNEL clause is used to control the line spacing of line printers.

The ALPHABET clause specifies a user-defined alphabet name that can be used to indicate a collating sequence in the PROGRAM COLLATING SEQUENCE clause.

Ex:-

SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP.

INPUT-OUTPUT SECTION:

The section contains information regarding files to be used in the program. There are two paragraphs in this section – FILE-CONTROL and I-O-CONTROL.

FILE-CONTROL:

The FILE-CONTROL paragraph names each file and identifies the file medium through file control entries.

The simplified format of a file control entry is given below.

SELECT [OPTIONAL] file-name ASSIGN TO hardware-name.

In general, a COBOL source program uses some files. For each of these files, there must be a FILE-CONTROL entry. This entry names the file and assigns a peripheral device which holds that particular file. The file names that appear in the SELECT clause must be unique and all these files must be described in DATA DIVISION. The file name should be formed according to the rules of data names.

The word OPTIONAL may be used only for input files.

Ex:-

FILE-CONTROL

SELECT CARD-DESIGN ASSIGN TO READER.

SELECT PRINTER-FILE ASSIGN TO PRINTER.

No comments:

Post a Comment