Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why occur class cant come in 01 level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Why occur class cant come in 01 level
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    Post subject:
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    Post subject:
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: 1203
Location: India

PostPosted: Fri Mar 04, 2005 2:16 am    Post subject:
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    Post subject: Re: Why occur class cant come in 01 level
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: 1203
Location: India

PostPosted: Sat Mar 05, 2005 11:45 pm    Post subject: Re
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts XFACILIT class setting for Fault Anal... egrove IBM Tools 2 Thu Aug 11, 2016 8:02 pm
No new posts Missing Java main class akg Java & MQSeries 3 Wed May 25, 2016 4:05 pm
No new posts Syncsort TPF Level Majid Hussain SYNCSORT 2 Wed Apr 13, 2016 2:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us