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
 

 

multidimensional table using occurs clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Tue Feb 24, 2009 3:51 pm    Post subject: multidimensional table using occurs clause
Reply with quote

Any one please explain about the multi dimensional occurs clause. I studied that the dimension is upto 7 times. Please explain me on this little bit elaborately.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Tue Feb 24, 2009 4:16 pm    Post subject:
Reply with quote

It's not clear what you're asking -- are you wanting to know the syntax of using multiple OCCURS clauses (in which case, the manuals link at the top of the page takes you to the COBOL Language Reference which will explain in complete detail), or why someone would want to use multiple OCCURS clauses (such as a report layout giving values for page, row, column -- 3 OCCURS clauses needed)?
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Tue Feb 24, 2009 4:47 pm    Post subject:
Reply with quote

please provide with syntax for this example
Code:

01 Rooms
   20 Cupboards
      30 racks
         40 books
            50 Pages
               60 rows
                  70 columns


Is it possible to have this much number of dimensions in occurs clause and what is the maximum limit I want to know.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 4:59 pm    Post subject:
Reply with quote

no, each demension is defined by an occurs clause.

The documentation about your compiler will tell you the number of demesions that you can define.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Tue Feb 24, 2009 5:08 pm    Post subject:
Reply with quote

Quote:
Is it possible to have this much number of dimensions in occurs clause and what is the maximum limit I want to know.
At the top of the page, there is a link to manuals. Click on it, find the COBOL manual for your system, and review the compiler limits section. What you're asking is in the manuals.
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Tue Feb 24, 2009 5:10 pm    Post subject:
Reply with quote

Code:

01 books-details.
   20 Rooms                       pic 9(02) occurs 2 times.
   20 Cupboards                  pic 9(02) occurs 2 times.
   20 racks                        pic 9(02) occurs 2 times.
   20 books                         pic 9(02) occurs 2 times.
   20 Pages                        pic 9(02) occurs 2 times.
   20 rows                         pic 9(02) occurs 2 times.
   20 columns                    pic 9(02) occurs 2 times.

Is this syntax is correct?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 5:18 pm    Post subject:
Reply with quote

saroragu,
you have 7 one demensional tables within the structure Book-details.

if you increase the level-numbers, then each new level will represent a new demension.
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: Tue Feb 24, 2009 8:25 pm    Post subject:
Reply with quote

Hello,

Quote:
Is this syntax is correct?
It would compile, but is probably not what you want. . .

It is better to have a requirement and then find a solution for it rather than have a solution and go looking for a requirement so it can be used. Keep in mind that a multi-dimensional array is not a requirement (unless it is a school assignment). The solution would meet some business need. Arrays might help implementing the solution.
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Wed Feb 25, 2009 9:07 am    Post subject:
Reply with quote

Thanks a lot for providing this detail.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm


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