Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Memory space for Working Storage (WS) variables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Bharti P Manglani

New User


Joined: 13 Mar 2007
Posts: 16
Location: Pune

PostPosted: Fri Jun 29, 2007 11:15 am    Post subject: Memory space for Working Storage (WS) variables
Reply with quote

Hi All,

I have a query:

Suppose i have declared a variable as X(10) in a COBOL program. Now if i change the size of the varible to X(200) what will happen to the size of the load module?

1) increase
2) decrease
3) remains the same
4) remains the same, as WS variables are dynamically populated
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 29, 2007 11:41 am    Post subject:
Reply with quote

Hello,

Please use the "SEARCH" link near the top of the page. Your exact question has been discussed before.

As i recall from the earlier topic, people who actually tested this found that increasing the ws sometimes caused the module size to increase and sometimes it did not.
Back to top
View user's profile Send private message
Bharti P Manglani

New User


Joined: 13 Mar 2007
Posts: 16
Location: Pune

PostPosted: Fri Jun 29, 2007 11:53 am    Post subject: Re: Memory space for Working Storage (WS) variables
Reply with quote

My apologies for not using the search.

But i was asked this question in the written test, and had these alternatives. So if the size sometimes increases and sometimes remains the same, what can i answer in the written test?

Is it an anomalous condition?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 29, 2007 12:12 pm    Post subject:
Reply with quote

Not to worry icon_smile.gif

As far as the written test, i am not certain which answer they are/were looking for. The only one i'm fairly sure of is that the module size will not decrease.

Please clarify this
Quote:
Is it an anomalous condition?
Back to top
View user's profile Send private message
Bharti P Manglani

New User


Joined: 13 Mar 2007
Posts: 16
Location: Pune

PostPosted: Fri Jun 29, 2007 12:51 pm    Post subject: Re: Memory space for Working Storage (WS) variables
Reply with quote

by this i meant that is it a kind of a defect or so? like sometimes it increases and sometimes remains the same.

anyways, thanks a lot for your help!! icon_smile.gif

i hope i dont get that question again in future!! icon_biggrin.gif
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Fri Jun 29, 2007 9:52 pm    Post subject:
Reply with quote

I believe Dick is right.

However, I would not be surprised to hear that they think the correct answer is 4. That would have been my answer before reading what Dick had to say. But I believe Dick is correct that 4 is not the correct answer.

In Assembler, the MVC statement (MOVE statement) can handle character fields up to 255 bytes in length. A char fields that is - say - 300 bytes long will require 2 MVC commands OR 1 MVCL (move long) statement. The use of 2 MVC commands or the use of MVCL will increase the load size.

So it seems to me that the compiler may have to generate different machine code depending on the length of the field.

On the other hand, a field that increases in size from - say - 200 bytes to 230 bytes, should not cause the load module size to increase.

Additionally, the compiler generates logic to load base registers. Each base register can address a 4K chunk of working storage - also referred to as a BLW. If I increase the size of working storage such that an extra BLW is required, the compiler might need to generate extra machine code to load that base register. And this would increase the load size, right? I wouldn't bet my life on this but I'm pretty sure that's how it works..

When I get a chance I will do a few experiments to see whether what I just said makes sense or is full of baloney.

Now - the storage required by the field itself is dynamically allocated so the field on its own will not increase the size of the LOAD module. However, the statements that act on the field may or may not cause the size to increase.
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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts The TS7720 is out of cache space. Rex Montemayor All Other Mainframe Topics 2 Mon Sep 25, 2017 7:18 am
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts ISREDIT MACRO NOT WORKING! :cry: kirank889 TSO/ISPF 3 Thu Aug 03, 2017 5:46 pm

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