Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
bharath.kalli

New User

Joined: 13 May 2010
Posts: 7
Location: Chennai

 Posted: Tue Oct 19, 2010 10:45 am    Post subject: Finding the bytes of an occurs clause 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…?

Kurt Deininger

New User

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

Posted: Tue Oct 19, 2010 11:53 am    Post subject:

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
bharath.kalli

New User

Joined: 13 May 2010
Posts: 7
Location: Chennai

 Posted: Tue Oct 19, 2010 12:33 pm    Post subject: Reply to: Finding the bytes of an occurs clause Thx for the reply. Now I can get the perfect answer.
GuyC

Senior Member

Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

 Posted: Tue Oct 19, 2010 12:47 pm    Post subject: 8(x) * 8(occurs) * 4(occurs) * 3 (occurs) = 8 * 8 * 4 * 3 = 768
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm finding delayed job/s in OPC jzhardy IBM Tools 0 Mon May 29, 2017 9:04 am Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us