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
 

 

Issues with having many 01 LEVEL variables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Issues with having many 01 LEVEL variables
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: 8002
Location: Bellevue, IA

PostPosted: Tue Jan 15, 2013 5:30 pm    Post subject:
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    Post subject: Reply to: Issues with having many 01 LEVEL variables
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    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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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