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
 

 

Finding the bytes of an occurs clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
bharath.kalli

New User


Joined: 13 May 2010
Posts: 7
Location: Chennai

PostPosted: Tue Oct 19, 2010 10:45 am    Post subject: Finding the bytes of an occurs clause
Reply with quote

01 Sample-Table.
05 Table-X occurs 3 times indexed by INX-A.
10 Table-Row occurs 4 times indexed by INX-B.
15 Tab-Col occurs 8 times indexed by INX-C PIC X(8).

How many bytes will Table-X will occupy?
8, 64, 256…?
Back to top
View user's profile Send private message

Kurt Deininger

New User


Joined: 13 Jul 2010
Posts: 19
Location: Frankfurt/Germany

PostPosted: Tue Oct 19, 2010 11:53 am    Post subject:
Reply with quote

Try this:

Code:

       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID. ANYPROG.                                             
       ENVIRONMENT DIVISION.                                           
       DATA DIVISION.                                                   
       WORKING-STORAGE SECTION.                                         
       01  SAMPLE-TABLE.                                               
           05  TABLE-X OCCURS 3 TIMES INDEXED BY INX-A.                 
               10 TABLE-ROW OCCURS 4 TIMES INDEXED BY INX-B.           
                   15  TAB-COL OCCURS 8 TIMES INDEXED BY INX-C PIC X(8).
       PROCEDURE DIVISION.                                             
           DISPLAY 'LENGTH=' LENGTH OF SAMPLE-TABLE                     
           STOP RUN.                                                   


which produces:

Code:

LENGTH=000000768   
***               


Cheers Kurt
Back to top
View user's profile Send private message
bharath.kalli

New User


Joined: 13 May 2010
Posts: 7
Location: Chennai

PostPosted: Tue Oct 19, 2010 12:33 pm    Post subject: Reply to: Finding the bytes of an occurs clause
Reply with quote

Thx for the reply.

Now I can get the perfect answer.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Oct 19, 2010 12:47 pm    Post subject:
Reply with quote

8(x) * 8(occurs) * 4(occurs) * 3 (occurs) = 8 * 8 * 4 * 3 = 768
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Finding unreferenced datasets without... Alan Playford JCL & VSAM 5 Tue Jul 12, 2016 9:07 pm
No new posts Finding repetead surnames in differen... blackjack202 DFSORT/ICETOOL 7 Tue Jun 07, 2016 7:42 pm
No new posts Need help in Finding who changed the ... steve-myers JCL & VSAM 6 Wed Jan 27, 2016 9:01 pm
No new posts Finding a File Containing a Particula... rexx77 DFSORT/ICETOOL 8 Tue Dec 22, 2015 2:19 am


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