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: 8120
Location: East Dubuque, Illinois, USA

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: 6968
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: 8120
Location: East Dubuque, Illinois, USA

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: 6968
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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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