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

Finding the bytes of an occurs clause


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
Search our Forums:

Back to Top