I have some error in this program. When I compile, the Code show error like this
prak.cob: In paragraph 'isi-data-tabel':
prak.cob:34: Error: syntax error, unexpected '('
Please check code below, this is error in line 34:
isi-data-tabel. DISPLAY ( , ) 'cabang ', subscript-cabang, bulan ', subscript-bulan, ' : '. ACCEPT ( , ) jumlah-unit-terjual (subscript-cabang, subscript-bulan). DISPLAY SPACE.
this full code
IDENTIFICATION DIVISION.
PROGRAM-ID. tabel2.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ws-subscript.
02 subscript-cabang PIC 9.
02 subscript-bulan PIC 9.
01 tabel-penjualan-mobil.
02 cabang OCCURS 4 TIMES.
03 bulan OCCURS 3 TIMES.
04 jumlah-unit-terjual PIC 99.
77 total-penjualan-cabang PIC 99 VALUE 0.
SCREEN SECTION.
01 hapus-layar.
02 BLANK SCREEN.
PROCEDURE DIVISION.
program-utama.
PERFORM entry-tabel.
PERFORM tampilkan-tabel.
STOP RUN.
entry-tabel.
DISPLAY ' Pemasukan data ke dalam tabel dimensi dua: '.
PERFORM isi-data-tabel
VARYING subscript-cabang FROM 1 BY 1
UNTIL subscript-cabang > 4
AFTER subscript-bulan FROM 1 BY 1
UNTIL subscript-bulan > 3.
isi-data-tabel.
DISPLAY ( , ) 'cabang ', subscript-cabang, bulan ', subscript-bulan, ' : '.
ACCEPT ( , ) jumlah-unit-terjual (subscript-cabang, subscript-bulan).
DISPLAY SPACE.
tampilkan-tabel.
DISPLAY hapus-layar.
DISPLAY ' Menampilkan isi tabel berdimensi dua : '.
PERFORM display-data-tabel
VARYING subscript-cabang FROM 1 BY 1
UNTIL subscript-cabang > 4
AFTER subscript-bulan FROM 1 BY 1
UNTIL subscript-bulan > 3.
display-data-tabel.
DISPLAY ( , ) 'cabang ', subscript-cabang,
'bulan ', subscript-bulan, ' : ',
jumlah-unit-terjual (subscript-cabang, subscript-bulan).
DISPLAY SPACE.
ADD jumlah-unit-terjual (subscript-cabang, subscript-bulan)
TO total-penjualan-cabang.
IF (subscript-bulan = 3)
DISPLAY '*** Total penjualan per cabang = ', total-penjualan-cabang.
MOVE 0 TO total-penjualan-cabang.
I use OpenCOBOL 1.1.0 in Mac Environment as compiler.