Why does this give a me syntax error on line 8 (ENVIRONMENT DIVISION)? It was always allowed in all my old programs.
IDENTIFICATION DIVISION.
PROGRAM-ID. 'SYNTAX CHECK'
AUTHOR. T.R.LAKE.
REMARKS. THIS PROGRAM READS A DECK OF CARDS,
THEN LISTS EACH DATA CARD ON PRINTER.
DATE-WRITTEN. NOV. 1973.
*************************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CARD-FILE ASSIGN TO 'UR-2501-S-CARDIN'.
SELECT PRINT-FILE ASSIGN TO 'PRINTER'.
*************************************************************************
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-05-28
Program ID in quotes with an intervening space ?
Remarks is ancient syntax.
Probable cause two periods.
NOV. 1973.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why does this give a me syntax error on line 8 (ENVIRONMENT DIVISION)? It was always allowed in all my old programs.
Program ID in quotes with an intervening space ?
Remarks is ancient syntax.
Probable cause two periods.
NOV. 1973.
I tried removing lines 3-7 and I still get the error.
The quotes around the program ID were the problem.
PROGRAM-ID . SYNTAX-CHECK.
works.
Last edit: Tom Lake 2023-05-28
Change program-id to ONE word without single quotes as that is not a
default any way and finish with a period.
On 28/05/2023 18:54, Tom Lake wrote:
Are you sure? The old code was
PROGRAM-ID. 'SYNTAX CHECK'The new code is
PROGRAM-ID. SYNTAX-CHECK.I'm quite sure that the problem was the missing period, in this case:
PROGRAM-ID. 'SYNTAX CHECK'.should be fine - isn't it?