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

Why occurs clause can't be used in the 01 level


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

New User


Joined: 07 Mar 2005
Posts: 43

PostPosted: Fri Apr 01, 2005 4:58 pm
Reply with quote

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

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Fri Apr 01, 2005 5:14 pm
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
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: 1592

PostPosted: Sat May 14, 2005 8:22 pm
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
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
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: 1592

PostPosted: Wed May 18, 2005 5:33 am
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: 32
Location: Chennai

PostPosted: Wed May 18, 2005 11:12 am
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: 1592

PostPosted: Thu May 19, 2005 5:39 am
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: 26
Location: pune

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

it use to describe the fields only not the records.
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 ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Updating a 1 byte thats in occurs mul... DFSORT/ICETOOL 6
No new posts JPM Reports for each DB2 V12 Function... DB2 0
Search our Forums:

Back to Top