Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Two Dimensional Array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics
Author Message
suresh_gop

New User


Joined: 01 May 2005
Posts: 3
Location: india

PostPosted: Tue Jul 29, 2008 7:23 pm    Post subject: Two Dimensional Array
Reply with quote

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
View user's profile Send private message
References
Moved: Tue Jul 29, 2008 7:28 pm by superk From Mainframe COBOL to Off Topics
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3564
Location: Brussels once more ...

PostPosted: Tue Jul 29, 2008 8:05 pm    Post subject:
Reply with quote

WOW, an error. Any chance that you might describe the error to us ?
Back to top
View user's profile Send private message
Moved: Wed Jul 30, 2008 7:23 am by dick scherrer From Mainframe COBOL to Other Mainframe Topics
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8771
Location: 221 B Baker St

PostPosted: Wed Jul 30, 2008 7:27 am    Post subject:
Reply with quote

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
View user's profile Send private message
suresh_gop

New User


Joined: 01 May 2005
Posts: 3
Location: india

PostPosted: Wed Jul 30, 2008 9:08 am    Post subject: Re: Two Dimensional Array
Reply with quote

I just replaced variable DAY as DAY-IN and HOUR as HOUR-IN it works fine. no problem....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1