View previous topic :: View next topic
|
Author |
Message |
vijay singh chouhan
New User
Joined: 19 Oct 2007 Posts: 22 Location: mumbai
|
|
|
|
Hi,
there are two programs: tv072 and tv072a
tv072 calls the program tv072a.
i have made some changes in tv072a. actually i have added a control card which is replacing some hardcoded value in tv072a.
in control card a new variable is added .
am i required to add the same variable in linkage section as well?
am i required to make some changes in tv072 also (calling prog)
i have added the same variable in linkage section but getting error saying
NUMBER-FREE-USER" (variable name) was not a uniquely defined name.
please suggest what can be done |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Vijay,
Quote: |
in control card a new variable is added . |
Not sure what do you mean by control card in the program.
Is the value of so called CONTROL CARD depends on the main program? |
|
Back to top |
|
|
vijay singh chouhan
New User
Joined: 19 Oct 2007 Posts: 22 Location: mumbai
|
|
|
|
Murali,
control card is like i/p file only .instead of reading hardcoded value now it reads from control card.
no,the value does not depend on main prog.value in contol card is 1,which is used for substraction.(earliar predefined value is used).
using contrlo card value calculation is done in called prog and value is
stored in some variable. |
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
Hi Vijay
l am not damn sure that what you are asking.
If you are getting err message as 'NUMBER-FREE-USER' is not uniquely defined means, then the same variable might have declared more than one place or else remove declaration part of the variable from linkage section. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Vijay,
Not require to change main pgm or any new var inclusion in the linkage section. |
|
Back to top |
|
|
vijay singh chouhan
New User
Joined: 19 Oct 2007 Posts: 22 Location: mumbai
|
|
|
|
Hi Rajesh,
i know that but i want to know whether any declaration in linkage section is needed or not regarding this problem |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I don't think you will need to declare variable in Linkage section. You declare a variable in linkage section when it is an external reference, e.g. calling program is passing that variable to it. This is not the case in your program, you are calculating value locally.
Please correct if I misunderstood your question. |
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
I believe do not need to declare variable in Linkage section since you are doing the calculation internally ie in called program itself. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
am i required to add the same variable in linkage section as well?
am i required to make some changes in tv072 also (calling prog) |
How can You expect us to tell ??
We do know very little about Your logic flow, and the usage You make
of the variables inside Your program.
Some logic driven considerations..
If Your variable - filled with at compile time -
is internal to the called program
and is influencing only the called program flow,
making the variable a true variable - filled at run time -
should not influence the calling program...
but if the above does not hold,
then also the calling program must be modified accordingly |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You have a duplicate-name problem that is completely inside the called program. You added a new field in the linkage section that is a duplicate of a name used elsewhere in the code (maybe in a copybook).
If you change the name of this new field, your duplicate error will go away. If you are using that name in youjr procedure division, you need to make sure that you are referencing the correct field, not one that just happens to compile.
If you only make this change in the called module, you should only beed to re-compile the called module. If the module is called via a static call, you will need to relink the calling module(s). |
|
Back to top |
|
|
vijay singh chouhan
New User
Joined: 19 Oct 2007 Posts: 22 Location: mumbai
|
|
|
|
hello,
my problem is not with the error.it is about the logic related with
the linkage section.
i want to know which variables need to be declared in linkage section in case of other program calling this modified program(added new variables) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If the linkage section does not have some field that is passed between the calling program and the called program, the calling program does not need need new logic.
If you post your linkage section(s) and describe what your concern is, we may be able to offer better suggestions. You might also post the CALL(s) so we can see how you're communicating between the modules. |
|
Back to top |
|
|
|