View previous topic :: View next topic |
Author |
Message |
madhuroyus Beginner
Joined: 09 Jan 2006 Posts: 45 Topics: 14 Location: Bangalore
|
Posted: Tue May 30, 2006 2:11 am Post subject: Linkage Section Variables Declaration will depends on the pa |
|
|
Hi,
Please see the below code.
LINKAGE SECTION.
01 COMMON-DATA.
05 DATA-TO-SUBROUTINE PIC X(150).
05 DATA-FROM-SUBROUTINE PIC X(350).
PROCEDURE DIVISION.
MOVE "NEED FULL DATA" TO DATA-TO-SUBROUTINE.
CALL 'PROGRMB' USING COMMON-DATA.
In the above code, I am sending 500 bytes but only 150 bytes is having data. The 'PROGRMB' will return the 350 bytes data in DATA-FROM-SUBROUTINE field.
Here my question is, whether the memory is allocated for the total 500 bytes or only for 150 bytes.
More Explanation: Suppose if we dont move any data to the some of linkage section variables;Whether the Memory is allocated to all the linkage section variables or only for those variables which are used in calling program?
Suppose if its allocated memory to total linkage section variables even though it is not used all of them;When it is going to be allocated?either when it is calling a subprogram it self or while the called program returning to the main program.
Can some one please give me solution for this?
Thanks
Madhu _________________ Self confidence is something that says U will do it, when the rest of the world has exactly opposite view. |
|
Back to top |
|
|
madhuroyus Beginner
Joined: 09 Jan 2006 Posts: 45 Topics: 14 Location: Bangalore
|
Posted: Thu Jun 15, 2006 6:31 am Post subject: |
|
|
Guys,
Till now I have not seen any reply for this question.
I would like to know is there any solution for this or is there any thing wrong in this question.
Thanks
Madhu _________________ Self confidence is something that says U will do it, when the rest of the world has exactly opposite view. |
|
Back to top |
|
|
s_shivaraj Beginner
Joined: 21 Sep 2004 Posts: 140 Topics: 14 Location: Chennai, India
|
Posted: Fri Jun 16, 2006 8:50 am Post subject: |
|
|
Madhu,
The memory of 500 bytes will be allocated irrespective of whether you send the data or not. Based on the definition in Linkage section , the amount of memory will be allocated, and not based on the amount on data in the Linkage Fields 8) . _________________ Cheers
Sivaraj S
'Technical Skill is the Master of complexity, while Creativity is the Master of Simplicity' |
|
Back to top |
|
|
neilxt Beginner
Joined: 01 Mar 2004 Posts: 23 Topics: 1
|
Posted: Tue Sep 19, 2006 3:42 pm Post subject: Re: Linkage Section Variables Declaration will depends on th |
|
|
madhuroyus wrote: | Hi,
Please see the below code.
LINKAGE SECTION.
01 COMMON-DATA.
05 DATA-TO-SUBROUTINE PIC X(150).
05 DATA-FROM-SUBROUTINE PIC X(350).
PROCEDURE DIVISION.
MOVE "NEED FULL DATA" TO DATA-TO-SUBROUTINE.
CALL 'PROGRMB' USING COMMON-DATA.
In the above code, I am sending 500 bytes but only 150 bytes is having data. The 'PROGRMB' will return the 350 bytes data in DATA-FROM-SUBROUTINE field.
Here my question is, whether the memory is allocated for the total 500 bytes or only for 150 bytes.
More Explanation: Suppose if we dont move any data to the some of linkage section variables;Whether the Memory is allocated to all the linkage section variables or only for those variables which are used in calling program?
Suppose if its allocated memory to total linkage section variables even though it is not used all of them;When it is going to be allocated?either when it is calling a subprogram it self or while the called program returning to the main program.
Can some one please give me solution for this?
Thanks
Madhu |
Data in the Linkage Section is NOT allocated at all - it is provided by the calling module and should be allocated there.
The Called module uses the Linkage Section to map to the calling modules data areas. The calling module is responsible for the definition and structure of the data areas by e.g. defining it in Working Storage.
The called module should use Linkage Section to map to that data in the same way it was defined.
Based on the way the question is worded I think you're doing something entirely the wrong way around.
N. |
|
Back to top |
|
|
|
|