|
From: David E. <de...@us...> - 2005-08-05 02:51:32
|
John R. Culleton wrote:
> I have narrowed down my parse error to the following
> circumstance. When I create a template program for COBOL
> I cannot include the following:
> 000150 INPUT-OUTPUT SECTION.
> 000160 FILE-CONTROL.
>
> Unless I also include at least one SELECT statement. In other
> words the following causes an error:
>
> 000070 ENVIRONMENT DIVISION.
> 000080
> 000090 CONFIGURATION SECTION.
> 000100 SOURCE-COMPUTER. Linux.
> 000120 OBJECT-COMPUTER. Linux.
> 000140
> 000150 INPUT-OUTPUT SECTION.
> 000160 FILE-CONTROL.
> 000170
> 000180 DATA DIVISION.
>
> ... but the following does not:
>
> 000070 ENVIRONMENT DIVISION.
> 000080
> 000090 CONFIGURATION SECTION.
> 000100 SOURCE-COMPUTER. Linux.
> 000120 OBJECT-COMPUTER. Linux.
> 000140
> 000150 INPUT-OUTPUT SECTION.
> 000160 FILE-CONTROL.
> 000170 SELECT PRINTFILE ASSIGN TO PRINTER.
> 000180 DATA DIVISION.
> 000190
Actually the TC version of the 'INPUT-OUTPUT SECTION' conforms to the
COBOL 85 standard, which is as follows.
[ INPUT-OUTPUT SECTION. FILE-CONTROL. {file-control-entry} ...]
Meaning that the 'INPUT-OUTPUT SECTION' is optional, but if present it
must contain a 'FILE-CONTROL' clause and at least one or more
'file-control-entries'.
> In the latter case the absence of a matching FD statement does
> not cause an error.
Yes, that is a know bug.
> OTOH OpenCobol allows the first configuration without complaint.
> I like that better.
The specification may have changed for the COBOL 2002 standard or maybe
added an extention.
|