View previous topic :: View next topic
|
Author |
Message |
therasith
New User
Joined: 02 Jan 2004 Posts: 52 Location: chennai
|
|
|
|
Why occur class cant come in 01 level?
Pl reply asap |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi therasith,
I don't know. But why do you see it as a "HOT QUES"? |
|
Back to top |
|
|
mainframemouli
New User
Joined: 01 Mar 2005 Posts: 52 Location: Mysore
|
|
|
|
Quote: |
you may have lot of group item in your program so you cannot maintain the consistency
We are going repeat the fields and not the records thats why!!!!!!! |
|
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear therasith,
Quote: |
Why occur class cant come in 01 level? |
OCCURS Clause cannot be used in 01, 66, 77 and 88 levels.
There are many reasons for that:
1. 01 Level items are usually record level items. OCCURS clause is used for specifying multiple occurrences of fields and NOT the records.
2. If OCCURS clause specified in 01 level, you cannot perform search and search all operations in an efficient manner.
3. In COBOL, Table is nothing but a ?Structure of Array?. So you have to specify the array (occurs) within a structure (01 level).
4. In COBOL59, 01 and 77 levels are aligned on a double word boundary. So if you have multiple occurrences for an item declared in 01/77 level, each item should start in a Word Boundary. So CODASYL didn't allow to use OCCURS clause in 01 & 77 level to avoid unnecessary slack bytes. |
|
Back to top |
|
|
lokanathareddy
New User
Joined: 05 Mar 2005 Posts: 11 Location: pune
|
|
|
|
therasith wrote: |
Why occur class cant come in 01 level?
Pl reply asap |
ans:
we use occurences of records so we cant use at 01 level.If u r use 01 level fields are occured.We dont want that result
lokanath |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Quote: |
We dont want that result |
Occurrences of records can be achieved by using occurs clause in 02-48 level.
01 A.
02 A1 OCCURS 10 TIMES.
03 A2 PIC 9(2).
Now A1 is a record, isn't it? |
|
Back to top |
|
|
|