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

difference between occurs declaration


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shrinivas_3
Warnings : 1

New User


Joined: 05 Sep 2006
Posts: 34

PostPosted: Tue Sep 05, 2006 12:55 pm
Reply with quote

Hi all

I want to know the difference between below declaration of arrays.


01 WS-ARRAY.
10 WS-OFR-ID-AY-HST OCCURS 3 TIMES .
15 WS-OFFER-ID-ARRAY PIC x(10).
15 WS-BK-ID-ARRAY PIC X(5).
15 WS-LNK-ID-ARRAY PIC X(20).

AND

01 WS-ARRAY.
10 WS-OFFER-ID-ARRAY PIC x(10) OCCURS 3 TIMES
10 WS-BK-ID-ARRAY PIC x(5) OCCURS 3 TIMES
10 WS-LNK-ID-ARRAY PIC x(20) OCCURS 3 TIMES


IS the total memory required same?
any performance issue ?

thanks
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Sep 05, 2006 1:02 pm
Reply with quote

Toal memory required by both the declaration willbe the same...
BUt u have advantage of the first declaration ...
- In this u can relatiavely access the variable like... if WS-BK-ID-ARRAY = 1223 then u can access relative value of WS-LNK-ID-ARRAY ...
It is usefule if both r relative....
means... if we have two variable like empid & empname...


Correction r welcome
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Updating a 1 byte thats in occurs mul... DFSORT/ICETOOL 6
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
Search our Forums:

Back to Top