COBOL Configuration Section

COBOL Environment Division COBOL Input Output Section

Advertisements


CONFIGURATION SECTION describes about the hardware where the program needs to compile or needs to run.

All the entries in CONFIGURATION SECTION should code in AREA A.

Syntax:
	[Optional]	 [CONFIGURATION SECTION. 
	[Optional]	 [SOURCE-COMPUTER. {source-computer-entry}]
	[Optional]	 [OBJECT-COMPUTER. {object-computer-entry}]
	[Optional]	 [SPECIAL-NAMES.   {special-names-entry}]]

SOURCE-COMPUTER:

* SOURCE-COMPUTER used for providing the computer system on which source program will be compiled.

The SOURCE-COMPUTER describes that to the computer on how the source program to compile that whether the debugging mode switch on at compile time or not.

DEBUGGING MODE:

DEBUGGING MODE syntax was in the following format:

   	[SOURCE-COMPUTER. [computer-name [WITH DEBUGGING MODE].]]

If the DEBUGGING MODE enabled on SOURCE-COMPUTER, the program recognize the statements which had D in the 7th columns as a part of code. During the execution, the statements will be executed along with the flow.

If the DEBUGGING MODE not enabled on SOURCE-COMPUTER, the program will not recognize the statements which had D in the 7th columns as a part of code. During the execution, the statements will be ignored and not considered.

DEBUGGING MODE is optional entry.

OBJECT-COMPUTER:

* OBJECT-COMPUTER used for providing the computer system on which the object program will run.

OBJECT-COMPUTER has no effect on the program execution.

OBJECT-COMPUTER not specified in the program, the program will run on the current machine.

SPECIAL-NAMES:

* SPECIAL-NAMES used for providing symbolic characters and the relationship of special function names to mnemonic names existing in the source program.

In other words, User can able create the constant entries for validating the particular fields at a program level.

SPECIAL-NAMES Example:
	SEPCIAL-NAMES.
		CLASS WS-VALID-OWEL IS
			‘A’  ‘E’ ‘I’ ‘O’ ‘U’.

	In PROCEDURE DIVISION,

		IF WS-INPUT IS WS-VALID-OWEL
			DISPLAY ‘INPUT IS OWEL’
		ELSE
			DISPLAY ‘INPUT IS NOT OWEL’
		END-IF.

WITH DEBUGGING MODE Practical Example:

The simple configuration section program example WITH DEBUGGING MODE was shown below

The above example describes about the SOURCE-COMPUTER with DEBUGGING MODE working.

In the below program SOURCE-COMPUTER with DEBUGGING MODE is enabled and compiled.

There was one DISPLAY statement coded along with D in the 7th Column which is the DEBIGGING MODE statement.

D DISPLAY ‘ DEBUGGING MODE ENABLED FOR THIS PROGRAM…’.

DEBUGGING MODE was disabled in the below program. So the above DISPLAY was considered as part of code and displayed in the output.

WITHOUT DEBUGGING MODE Practical Example:

The simple configuration section program example WITHOUT DEBUGGING MODE was shown below

The below example describes about the SOURCE-COMPUTER without DEBUGGING MODE working

Let’s take the above program and disable DEBUGGING MODE and compile the program.

There was one DISPLAY statement coded along with D in the 7th Column which is the DEBIGGING MODE statement.

D DISPLAY ‘ DEBUGGING MODE ENABLED FOR THIS PROGRAM…’.

DEBUGGING MODE was disabled in the below program. So the above DISPLAY was not considered as part of code and not displayed in the output.


If any questions on the above, post your queries on Cobol Discussion forum


COBOL Environment Division COBOL Input Output Section

Advertisements