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

Memory space for Working Storage (WS) variables


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Jun 29, 2007 11:41 am
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
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

Moderator Emeritus


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

PostPosted: Fri Jun 29, 2007 12:12 pm
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
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: 148
Location: Ottawa Canada

PostPosted: Fri Jun 29, 2007 9:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts CICS vs LE: STORAGE option CICS 0
Search our Forums:

Back to Top