Skip to content

Errors occur in code containing SORT statements #248

@ppputtyo

Description

@ppputtyo

When converting COBOL code containing the SORT statement to Java, the following error occurs:

./SAMPLE.java:181: error: cannot find symbol
          CobolFileSort.sortTableInit (1, 0);
                       ^
  symbol:   method sortTableInit(int,int)
  location: class CobolFileSort
./SAMPLE.java:182: error: cannot find symbol
          CobolFileSort.sortTableInitKey (0, f_S__WORK$1, 0);
                       ^
  symbol:   method sortTableInitKey(int,AbstractCobolField,int)
  location: class CobolFileSort
./SAMPLE.java:183: error: cannot find symbol
          CobolFileSort.sortTable (f_S__WORK$1, 200000);
                       ^
  symbol:   method sortTable(AbstractCobolField,int)
  location: class CobolFileSort
3 errors

Reproduction

Environment: Ubuntu 22.04 (WSL)
Version of cobj: 1.0.16

Code

IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN ASSIGN TO KEYBOARD ORGANIZATION LINE SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD SYSIN.
01 INDATA     PIC X(200000).
01 REDEFINES INDATA.
   03 S       PIC X OCCURS 200000.
WORKING-STORAGE SECTION.

PROCEDURE DIVISION.
  OPEN INPUT SYSIN.
  READ SYSIN.
  CLOSE SYSIN.
  SORT S ASCENDING S.
  DISPLAY FUNCTION TRIM(INDATA).
  STOP RUN.

Command

cobj -free sample.cbl

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions