Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8551
Location: Dubuque, Iowa, USA

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 Feild level validation to test first ... sruthi3466 JCL & VSAM 10 Thu Apr 23, 2020 2:47 pm
No new posts Not able to view the values of variab... sattar_engg CA Products 1 Thu Jan 23, 2020 12:32 pm
No new posts Large'ish Working Storage and SOS issues govindc CICS 0 Sat Jan 18, 2020 1:58 am
No new posts Comparison of numeric edited variables Nileshkul COBOL Programming 4 Sat Mar 16, 2019 1:18 am
No new posts Backup issues after upgrade to zOS 2.2 netcrawler All Other Mainframe Topics 0 Mon Feb 25, 2019 12:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us