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 occurs clause can't be used in the 01 level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 54
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: 1592

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: 1592

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: 32
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: 1592

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: 26
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
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 Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 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
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts Multiple OCCURS depending on in same ... muralirajansm COBOL Programming 6 Fri Aug 21, 2015 4:23 pm


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