Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> All Other Mainframe Topics
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    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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

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
dick scherrer

Site Director


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

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: 4
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts COBOL Program to Read Array data raj4neo COBOL Programming 8 Sat Aug 15, 2015 12:28 am
No new posts Checking for High-Values in an array amitc23 COBOL Programming 10 Wed Aug 05, 2015 4:09 pm
No new posts How to define and use Double dimensio... pkmurali DB2 3 Mon Jun 22, 2015 8:36 am
This topic is locked: you cannot edit posts or make replies. How to Compare two values in an inter... ritnihi COBOL Programming 6 Wed Jun 10, 2015 11:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us