aboutsummaryrefslogtreecommitdiff
path: root/examples/cobol/Max_array.cob
blob: 006139e6ef3995435a711e30a676b871277113ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
       identification division.
       program-id. Max_array.
       data division.
       working-storage section.
           01 ws-array-1 pic s9(8) occurs 65535 times.
           01 ws-array-2 pic s9(8) occurs 65535 times.
           01 i pic s9(8) comp.
       procedure division.
           move 0 to i.
           perform varying i from 1 by 1 until i > 65535
               if ws-array-1(i) > ws-array-2(i)
                   move ws-array-1(i) to ws-array-2(i)
               end-if
           end-perform.
           stop run.