MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Linkage Section Variables Declaration will depends on the pa

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
madhuroyus
Beginner


Joined: 09 Jan 2006
Posts: 45
Topics: 14
Location: Bangalore

PostPosted: Tue May 30, 2006 2:11 am    Post subject: Linkage Section Variables Declaration will depends on the pa Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
madhuroyus
Beginner


Joined: 09 Jan 2006
Posts: 45
Topics: 14
Location: Bangalore

PostPosted: Thu Jun 15, 2006 6:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
s_shivaraj
Beginner


Joined: 21 Sep 2004
Posts: 140
Topics: 14
Location: Chennai, India

PostPosted: Fri Jun 16, 2006 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
neilxt
Beginner


Joined: 01 Mar 2004
Posts: 23
Topics: 1

PostPosted: Tue Sep 19, 2006 3:42 pm    Post subject: Re: Linkage Section Variables Declaration will depends on th Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group