IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Two Dimensional Array


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suresh_gop

New User


Joined: 01 May 2005
Posts: 4
Location: india

PostPosted: Tue Jul 29, 2008 7:23 pm
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
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jul 29, 2008 8:05 pm
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
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 30, 2008 7:27 am
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: 4
Location: india

PostPosted: Wed Jul 30, 2008 9:08 am
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts How to move values from single dimens... COBOL Programming 1
No new posts array indexing PL/I & Assembler 4
No new posts COBOL batch program using large size ... COBOL Programming 3
Search our Forums:

Back to Top