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

Difference between level 01 and level 77.


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

New User


Joined: 21 Mar 2005
Posts: 18
Location: India

PostPosted: Thu Jul 05, 2007 10:52 am
Reply with quote

I have a query regarding level 01 and 77.
Both can represent elementary data. So what is the advantage of using level 77?

Thanks in Advance,
Somnath
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu Jul 05, 2007 11:04 am
Reply with quote

Code:
Both can represent elementary data.


The above is true but 77 level can represent only elementary data.The element in 77 cannot be subdivided or cannot have a group of subelements .This is to indicate the variable declared in 77 is an elementary(some thing for special purpose) and should not be subdivided .

Level 01 can be elementary item or a part of a group item.

Code:
01 ws-a.
   02 ws-b pic x(02).
   02 ws-c pic x(03).

the above code is possible.
Code:
77 ws-a.
   02 ws-b pic x(02).
   02 ws-c pic x(03).


the above code is not possible.


hope this help
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Jul 05, 2007 11:21 am
Reply with quote

muthuvel - Question is
Quote:
what is the advantage of using level 77?
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Thu Jul 05, 2007 11:22 am
Reply with quote

somnath wrote:
what is the advantage of using level 77?

the address. a 77 level field always starts at a "full word boundery". e.g.
Code:

01  foo.
    03 filler  pic X value space.
    03 count-a pic s9(9) binary value zero.
77  count-b     pic s9(9) binary value zero.

add 1 to count-a.
add 1 to count-b.
count-a does not start at a full-word boundery, count-b does. In theory the 2nd ADD generates more efficient code (less instructions) than the 1st.

If it can be measured..... dunno never tried.
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 Timestamp difference and its average ... DB2 11
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts What is the difference between Taskty... Compuware & Other Tools 2
Search our Forums:

Back to Top