View previous topic :: View next topic
|
Author |
Message |
suresh_gop
New User
Joined: 01 May 2005 Posts: 4 Location: india
|
|
|
|
Hi,
I tried a small two dimensional array program but it returns an error.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. SIMPLE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 TEMP.
05 DAY OCCURS 7 TIMES.
10 HOUR OCCURS 24 TIMES PIC 99.
05 I PIC 99.
05 J PIC 99.
PROCEDURE DIVISION.
100-MAIN.
PERFORM ACC-PARA VARYING I FROM 1 BY 1 UNTIL I > 7
AFTER J FROM 1 BY 1 UNTIL J > 24.
PERFORM DIS-PARA VARYING I FROM 1 BY 1 UNTIL I > 7
AFTER J FROM 1 BY 1 UNTIL J > 24.
STOP RUN.
ACC-PARA.
DISPLAY "ENTER A DAY".
ACCEPT HOUR(I,J ).
DIS-PARA.
DISPLAY HOUR(I,J).
DISPLAY I J.
|
Thanks... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
WOW, an error. Any chance that you might describe the error to us ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forums,
While posting your code was a good thng to do, you should also post the error(s) presented by the system.
Your problem may be that you are trying to use display/accept to get the input which many systems do not permit.
You will be ahead to put your "input" in a file and read it rather that trying to "accept" all of the values you could enter. |
|
Back to top |
|
|
suresh_gop
New User
Joined: 01 May 2005 Posts: 4 Location: india
|
|
|
|
I just replaced variable DAY as DAY-IN and HOUR as HOUR-IN it works fine. no problem.... |
|
Back to top |
|
|
|