Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Why occurs clause can't be used in the 01 level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
prabhucs01

New User


Joined: 07 Mar 2005
Posts: 40

PostPosted: Fri Apr 01, 2005 4:58 pm    Post subject: Why occurs clause can't be used in the 01 level
Reply with quote

why occurs clause can't be used in the 01 level?
Back to top
View user's profile Send private message
References
rsshanmugam

Active User


Joined: 08 Mar 2005
Posts: 53
Location: Chennai

PostPosted: Fri Apr 01, 2005 5:14 pm    Post subject:
Reply with quote

01 level is used for describing records not fields in cobol, since at a given single instance a record cant occur more than one time occurs clause cant be given at 01 level
Back to top
View user's profile Send private message
shiva_suresh
Warnings : 2

New User


Joined: 05 May 2005
Posts: 11
Location: Bangalore

PostPosted: Sat May 14, 2005 4:04 pm    Post subject: Occur clause can be used on 01 level
Reply with quote

Plz tell me the answer asap
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Sat May 14, 2005 8:22 pm    Post subject:
Reply with quote

Hi Shiva,

I guess that answer has to be "because you'll get a comiler error otherwise". icon_biggrin.gif I've never seen any "official" IBM answer to that ques.

Those "UNofficials" that I've seen don't seem to ring true.

My guess is that it has something to do with the fact that 01 levels must begin on double word storage boundaries; if they aren't, filler (slack) bytes are inserted by the compiler to make it happen. If you do that with multiple table entries, the entry data definition can become misaligned with the data from entry to entry.

But, again that's just my guess.

HTH
Back to top
View user's profile Send private message
nave

New User


Joined: 16 May 2005
Posts: 10
Location: bangalore,india

PostPosted: Mon May 16, 2005 6:03 pm    Post subject:
Reply with quote

once we give occurs clause in a 02 field it need to be occured that much times were as since the 01 level is the group variable we dont need to occur the address space of the group variable.so no need of occurs clause in 01 level.it should not be said 'not allowed',it is to be said to be of 'no nned to write occurs clause in 01 level'.
Back to top
View user's profile Send private message
Prakash_mainframes

New User


Joined: 26 Feb 2005
Posts: 5
Location: Pune

PostPosted: Tue May 17, 2005 3:27 pm    Post subject: Re: Why occurs clause can't be used in the 01 level
Reply with quote

I have one more query then.....

Can 88 level be used under an OCCURS clause?

For ex:
For Ex:

01 Dept.
05 ABC pic 9(3) occurs 5 times.
88 valid value 0 thru 100.

and if we move any value to the VALID field, then that value will be assigned to all ABC or how wil it happen?

Regards,
Prakash.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Wed May 18, 2005 5:33 am    Post subject:
Reply with quote

Yes, but you have to subscript/index it. E.g.:

if valid(3)
etc.
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 33
Location: Chennai

PostPosted: Wed May 18, 2005 11:12 am    Post subject:
Reply with quote

Hi

Can anybody tell whether its is possible to move any values to the VALID field as mentioned above.

Ref:
01 Dept.
05 ABC pic 9(3) occurs 5 times.
88 valid value 0 thru 100.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Thu May 19, 2005 5:39 am    Post subject:
Reply with quote

Hi Ajay,

Yes you can. Example:
Code:

move 6 to abc(5).
Back to top
View user's profile Send private message
samchris

New User


Joined: 31 May 2005
Posts: 27
Location: pune

PostPosted: Tue May 31, 2005 6:22 pm    Post subject:
Reply with quote

it use to describe the fields only not the records.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1