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

Why we prefer level no 77 for defining elementary item


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

New User


Joined: 15 Feb 2006
Posts: 5
Location: Noida

PostPosted: Wed Feb 15, 2006 7:17 pm
Reply with quote

Hi all,
We can use level number 01 and 77 both for elementary item.but why it is always recommended to use 77 instead of 01.


Thx in advance

Yogesh
Back to top
View user's profile Send private message
Nirmala

New User


Joined: 13 Feb 2006
Posts: 3

PostPosted: Wed Feb 15, 2006 7:30 pm
Reply with quote

Hi,
Any item declared in Level 01 will have Duble Word boundary set by the system .. which will occupy more space.

Regards
Nirmala
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Wed Feb 15, 2006 7:42 pm
Reply with quote

Hai,
If u mentioned as 01 item, in future it can be sub grouped. But if u mentioned as 77 item it will be remained as elementary item only.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Feb 15, 2006 10:17 pm
Reply with quote

http://ibmmainframes.com/viewtopic.php?t=1239

Regards,

Priyesh.
Back to top
View user's profile Send private message
Yogesh_agarwal

New User


Joined: 15 Feb 2006
Posts: 5
Location: Noida

PostPosted: Tue Feb 21, 2006 7:10 pm
Reply with quote

Hi,
Thanks a lot to all of you.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Feb 22, 2006 12:21 pm
Reply with quote

Earlier versions of COBOL had a difference in the way the data was stored/accessed when you use a 77 and 01 level.

77 level was boundary aligned and 01 level was not boundary aligned .

Boundary alignment used to dictate the number of bytes used for actual storage, addressability and fetching.
The minimum fetch unit used to be a word and so even if your character size is less than a word all the bytes in the word would be used for storing the value. There was no impact on the fetch time for the character variables .

In addition to the storage , when the declaration is for numeric values and if the numeric values are used in any kind of intensive computation , the declaration types would have an impact on the CPU time if they were declared at 01 level because of the non-alignment .

In MVS COBOL and VS COBOL II 01 level variables are also boundary aligned and have been hence there is no difference .

Let me know if i am wrong.
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 Defining a struct PL/I & Assembler 3
No new posts TSQ Item Count increments to plus 1 CICS 1
No new posts defining a global LUA function in Inf... IBM Tools 1
Search our Forums:

Back to Top