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

Issues with having many 01 LEVEL variables


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

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Tue Jan 15, 2013 4:10 pm
Reply with quote

Hi,

I have following doubt in 01 level variables declaration in COBOL program.

for example:
01 ws-file-status 9(02).

I heard that though the variable is asking for 2 chars, still mainframe will allocate 1 FULL WORD since the variable is declared as 01 LEVEL. Could some let me know whether this is correct or not?


Thanks,
Mallik
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 15, 2013 5:30 pm
Reply with quote

There is a link to manuals at the top of this page. If you click on it, and find the COBOL Language Reference manual, section 5.3.16 has this:
Quote:
In the working-storage section, the compiler aligns all level-01 entries on a doubleword boundary.
So the answer is, you are wrong. The compiler aligns 01 levels on the double word, meaning a 2-byte 01 level actually uses 8 bytes of storage, not 4.

However, the question comes up as to WHY you are concerned? Since the COBOL WORKING-STORAGE can be over 130 million bytes, you would need more 01 levels than you want to key before you have any problem.
Back to top
View user's profile Send private message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Tue Jan 15, 2013 7:10 pm
Reply with quote

Thank you very much Robert for the quick reply.
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts How to load to DB2 with column level ... DB2 6
No new posts Issues with VIEW DATASET Command CLIST & REXX 2
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts JCL with variables JCL & VSAM 1
Search our Forums:

Back to Top