View previous topic :: View next topic
|
Author |
Message |
Bharti P Manglani
New User
Joined: 13 Mar 2007 Posts: 16 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bharti P Manglani
New User
Joined: 13 Mar 2007 Posts: 16 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Not to worry
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 |
|
|
Bharti P Manglani
New User
Joined: 13 Mar 2007 Posts: 16 Location: Pune
|
|
|
|
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!!
i hope i dont get that question again in future!! |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
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 |
|
|
|