Menu

Yet Another Problem

Tom Lake
2023-05-28
2023-05-28
  • Tom Lake

    Tom Lake - 2023-05-28

    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'.
          *************************************************************************
    
     
    • Anonymous

      Anonymous - 2023-05-28

      Program ID in quotes with an intervening space ?
      Remarks is ancient syntax.
      Probable cause two periods.
      NOV. 1973.

       
      • Tom Lake

        Tom Lake - 2023-05-28

        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
        • Vincent (Bryan) Coen

          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:

          I tried removing lines 3-7 and I still get the error.

           
        • Simon Sobisch

          Simon Sobisch - 2023-05-28

          The quotes around the program ID were the problem.

          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?

           

Anonymous
Anonymous

Add attachments
Cancel