Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#68 SORT: Bug depending on level defintion

GC 2.0
closed
None
8
2014-11-24
2014-02-25
Simon Sobisch
No

Opened from [0fea8635]

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TestSort.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 k             pic 9(2).

       01 Anz1          pic 9(9) comp-5 value 4.
       01 tab1.
          05 zeile1 OCCURS 1 to 4 depending Anz1 
                                 descending tab1-nr.
             10 tab1-nr pic 99.

       01 tab2.
          05 Anz2          pic 9(9) comp-5 value 4.
          05 zeile2 OCCURS 1 to 4 depending Anz2 
                                 descending tab2-nr.
             10 tab2-nr pic 99.

       procedure division.
       a.
           perform varying k from 1 by 1 until k > 4
             move k to tab1-nr(k), tab2-nr(k)
           end-perform

           sort zeile1 descending tab1-nr
           sort zeile2 descending tab2-nr

           display "single table" end-display
           perform varying k from 1 by 1 until k > 4
             display  tab1-nr(k) end-display
           end-perform
           display " " end-display

           display "lower level table" end-display
           perform varying k from 1 by 1 until k > 4
             display  tab2-nr(k) end-display
           end-perform

           stop run.

Should output

single table
04
03
02
01

lower level table
04
03
02
01

But does not (only the first one works).
Occurs in 1.x, 2.x and 2.x CPP.

Simon

Related

Discussion: 0fea8635
Discussion: Table Sort

Discussion

  • Philipp Böhme
    Philipp Böhme
    2014-07-10

    fixed in [r341]

     

    Related

    Commit: [r341]

  • Philipp Böhme
    Philipp Böhme
    2014-07-10

    • status: accepted --> closed
    • assigned_to: Philipp Böhme
     
  • Simon Sobisch
    Simon Sobisch
    2014-11-24

    • Group: unclassified --> GC 2.0