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
 

 

will Size of load module change,when sizeof var increses?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Feb 28, 2007 3:24 pm    Post subject: will Size of load module change,when sizeof var increses?
Reply with quote

Hi,
I have this code
Code:

 WORKING-STORAGE SECTION.                           
  01  ABHI.                                         
    05  DUMMY-F         PIC X(5).

 

suppose I increased the picture clause of the variable. Will the size of load module change?
I compiled program and I got size of load 11C0.
Then I changed pic clause to X(500) it remained same.
When I changed pic clause to X(5000) size came 11D8.
Can anybody explain why this happened?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 28, 2007 3:44 pm    Post subject:
Reply with quote

Working storage is imbeded in the load module. If you increase the size of WS you will increase the size of the load module.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 28, 2007 3:51 pm    Post subject:
Reply with quote

Bill, TS increased the size of a variable from 5 to 500 but no changes in size. My guess is the compiler allocates blocks and not bits.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Feb 28, 2007 3:53 pm    Post subject: Why the difference in size
Reply with quote

In first case it has not increased? why?
When I increased it from 500 to 5000. Size difference is
11D8- 11C0 = 18H = 24 bytes.
I was expecting load module size should increase in both the cases also in second case it should increase by 4500 bytes?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Feb 28, 2007 3:56 pm    Post subject:
Reply with quote

Hi Abijit,
Why do u think that the size of the load module would increase, load module is one which contains the machine code for a given program , its size is only dependent apon the size of the program, the memory space allocation of variables would be done only during the run time and yes the load module willl tell the CPU main memory , how much space should be allocated for each and every variable during the run time , if u r using cobol analyse the usage of PICTURE clause for data declaration, u would find it interesting, the conclusion is the load module size is not dependent ionthe variable size that u have defined in the program.

Thamilzan.
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Wed Feb 28, 2007 3:58 pm    Post subject:
Reply with quote

Size will be changed.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Feb 28, 2007 4:12 pm    Post subject: After seeing the facts
Reply with quote

As I have exerimentally found that size of load module changes when we increase the pic clause.
Now as prav_06 says
"space allocation of variables would be done only during the run time"
I wanted to see the assembly listing of the program. Can anybody tell me how can I see that?
I am using CWPCMAIN COMPUWARE/COBOL COMPILER.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 28, 2007 4:14 pm    Post subject:
Reply with quote

Bitneuker wrote:
Bill, TS increased the size of a variable from 5 to 500 but no changes in size. My guess is the compiler allocates blocks and not bits.
Quote:
I compiled program and I got size of load 11C0.
Then I changed pic clause to X(500) it remained same.
When I changed pic clause to X(5000) size came 11D8.
Curious icon_confused.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 28, 2007 4:26 pm    Post subject:
Reply with quote

Did the size of the object change (the number of lines)?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Feb 28, 2007 5:08 pm    Post subject:
Reply with quote

Yes. It has changed.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 28, 2007 5:13 pm    Post subject:
Reply with quote

In both cases?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Feb 28, 2007 5:25 pm    Post subject:
Reply with quote

No. from 5 to 500 no change, from 500 to 50000 it did.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 28, 2007 7:00 pm    Post subject:
Reply with quote

So you have a larger object which logically results in a larger loadmodule. I've no intention to try and explain the increase why it's grown by x'18'.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Feb 28, 2007 9:07 pm    Post subject:
Reply with quote

Hi all,
Load module is to tell what the machine should do, and it gives the instruction to the i-o devices to accept or display data, consider this

Code:
     ACCEPT A.
    * A is defined as PIC X(50) For PGM 1.


and

Code:
     ACCEPT A.
    * A is defined as PIC X(5000) For PGM 2.


and lets consider that these two progs. have the same functionality with the same lines of code. For each prog. a load module would be created, and when these progs are executed (Runtime), the system encounters i-o instruction of ACCEPT A. PGM1 would be expecting 50 bytes of data from the user and PGM2 would be expecting 5000 bytes of data, during this the load module would just tell the i-o device to accept n number of bytes, where n=50 for PGM1 and n=5000 for PGM2, during the run time the load module would just pass the number of bytes to be allocated in the real memory , so when executing the instruction to accept, the corresponding machine instruction size in both the load modules will be same. Instead of sayin

Quote:
ACCEPT 2 DIGITS. for PGM1 its gonna say ACCEPT 4 DIGITS for PGM2

2- > No digits in 50
4- > No digits in 5000
.

This is my understanding. Please correct me if I am wrong.

Thamilzan.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 28, 2007 9:44 pm    Post subject:
Reply with quote

Bitneuker wrote:
So you have a larger object which logically results in a larger loadmodule. I've no intention to try and explain the increase why it's grown by x'18'.
Did a little experimenting and it did not make sense until, working an 0C7, noticed this in the AbendAid print: "Because the program is re-entrant, Working-Storage is located outside of the program."

My testing changed a little when I had a value on the storage, but not by more that a couple dozen bytes. I might try later without rent....
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: Wed Feb 28, 2007 9:57 pm    Post subject:
Reply with quote

Hello,

When you change the size of working storage, load module size may or may not change. Look at the linkedt and for each of the compiles and see if the actual object size for the module changed (it will when more/less object space is needed - not all changes result in an object length change). The length of the object module is only part of the overall length of the load module.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Thu Mar 01, 2007 11:52 am    Post subject:
Reply with quote

Quote:

When you change the size of working storage, load module size may or may not change.


I am totally confused now. icon_question.gif [/quote]
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Mar 01, 2007 3:00 pm    Post subject:
Reply with quote

Bill,

A couple of dozen bytes is the 24 bytes TS mentioned icon_wink.gif Co-incident icon_question.gif
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: Thu Mar 01, 2007 9:43 pm    Post subject:
Reply with quote

Hi Abhijit,

To better understand how the object module size varies, do some research on how an object module is constructed. There are 4 types of object records - ESD, TXT, RLD, and END.

The entries you will be interested in are the TXT entries.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Fri Mar 02, 2007 1:42 pm    Post subject:
Reply with quote

Quote:

To better understand how the object module size varies, do some research on how an object module is constructed. There are 4 types of object records - ESD, TXT, RLD, and END.


Dick,
Thanks for inputs. I will surely find out more about the process. icon_smile.gif

If the above question is asked at an interview, what is the answer?
i will say 'YES' after this discussion.
Does anyone want to differ icon_question.gif
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am


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