Skip to content

Add a field to access the paragraph/section in a SORT instruction with INPUT/OUTPUT #2000

@delevoye

Description

@delevoye

For now, the SortStatement contains only a SymbolReference InputProcedure and SymbolReference ThroughInputProcedure
(same for the output) but in order to know if these are references to a Section or a Paragraph, the SymbolTable or a cast with is has to be used, which is costly for nothing.

The idea is to have an interface similar to PerformProcedure which has a field for the section and a field for the paragraph : ParagraphSymbol ProcedureParagraphSymbol ParagraphSymbol ThroughProcedureParagraphSymbol SectionSymbol ProcedureSectionSymbol and SectionSymbol ThroughProcedureSectionSymbol.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    PGM.
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT Z-SORT-1 ASSIGN TO ZSORT1.

       DATA DIVISION.
       FILE SECTION.
       SD  Z-SORT-1.
       01  Z-SD-1-1-RECORD.
           05  Z-SD-1-1-KEY                           PIC 9(08).

       PROCEDURE DIVISION.
           SORT Z-SORT-1
               ON ASCENDING Z-SD-1-1-KEY
               INPUT PROCEDURE IS MY-SECTION1
               OUTPUT PROCEDURE IS MY-SECTION1.

       MY-SECTION1 SECTION.
       MY-PARA1.
           CONTINUE
           .
       END PROGRAM PGM.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions