Skip to content

Compile error on programs with 2 paragraphs with the same name on procedure division #1710

@alvaro-vantis-pt

Description

@alvaro-vantis-pt

Programs with 2 paragraphs with the same name on different sections on procedure division provides a compiler error on TypeCobol but no erros on z/OS compiler.

This is a sample of a program to reproduce the error:

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. TESTSEC.
002100*
002200 ENVIRONMENT DIVISION.
002300 CONFIGURATION SECTION.
002600 DATA DIVISION.
002700 WORKING-STORAGE SECTION.
002800 77 V1 PIC 9 VALUE 1.
002900 77 V2 PIC 9 VALUE 2.
013900 PROCEDURE DIVISION.
015100*
015500 BA010-INICIO.
015600
015700 PERFORM SD011-ENTER.
015800 GOBACK.
015900
043900 SD011-ENTER SECTION.
043910 DD011-ENTER.
044000*
044100 MOVE V1 TO V2.
045400*
045500 DD119-EXIT. EXIT.
045600*
045700 SD110-ENTER2 SECTION.
045800*-----------------------------------------------------*
045900 DD110-ENTER1.
046000*
046100 MOVE V2 TO V1.
047000*
047100 DD119-EXIT. EXIT.
047110*
047111 DD110-ENTER2.
047112*
047120 PERFORM DD110-ENTER1 THRU DD119-EXIT.
047200*

and/or steps to reproduce the behavior:
1. compile the above sample program

**Expected behavior**
Consider that paragraph names should be unique inside a section but not on whole procedure, and it can be referenced as described on "References to PROCEDURE DIVISION names " chapter of  on [Enterprise COBOL for z/OS Language Reference](https://github.com/TypeCobolTeam/TypeCobol/blob/develop/TypeCobol/Documentation/Reference/IBM%20Enterprise%20Cobol%205.1%20for%20zOS%20-%20Language%20Reference.pdf)

The following attachment contains z/OS compiler output:
z/OS compiler output: [compzos.zip](https://github.com/TypeCobolTeam/TypeCobol/files/4416122/compzos.zip)

Metadata

Metadata

Assignees

Labels

BugCobolUser VisibleVisible by the end user. Useful to priorize issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions