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

Why occur class cant come in 01 level


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

New User


Joined: 02 Jan 2004
Posts: 52
Location: chennai

PostPosted: Fri Feb 25, 2005 11:35 pm
Reply with quote

Why occur class cant come in 01 level?

Pl reply asap
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Feb 27, 2005 1:39 am
Reply with quote

Hi therasith,

I don't know. But why do you see it as a "HOT QUES"?
Back to top
View user's profile Send private message
mainframemouli

New User


Joined: 01 Mar 2005
Posts: 52
Location: Mysore

PostPosted: Tue Mar 01, 2005 5:49 pm
Reply with quote

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
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Fri Mar 04, 2005 2:16 am
Reply with quote

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
View user's profile Send private message
lokanathareddy

New User


Joined: 05 Mar 2005
Posts: 11
Location: pune

PostPosted: Sat Mar 05, 2005 10:17 am
Reply with quote

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
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Sat Mar 05, 2005 11:45 pm
Reply with quote

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
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 How to load to DB2 with column level ... DB2 6
No new posts building java class with zip4j.jar on... Java & MQSeries 0
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
No new posts JPM Reports for each DB2 V12 Function... DB2 0
Search our Forums:

Back to Top