IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Addiing variables in linkage section


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijay singh chouhan

New User


Joined: 19 Oct 2007
Posts: 22
Location: mumbai

PostPosted: Fri Oct 19, 2007 2:41 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Oct 19, 2007 2:45 pm
Reply with quote

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
View user's profile Send private message
vijay singh chouhan

New User


Joined: 19 Oct 2007
Posts: 22
Location: mumbai

PostPosted: Fri Oct 19, 2007 2:58 pm
Reply with quote

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
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Fri Oct 19, 2007 2:59 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Oct 19, 2007 3:01 pm
Reply with quote

Vijay,

Not require to change main pgm or any new var inclusion in the linkage section.
Back to top
View user's profile Send private message
vijay singh chouhan

New User


Joined: 19 Oct 2007
Posts: 22
Location: mumbai

PostPosted: Fri Oct 19, 2007 3:14 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Oct 19, 2007 3:24 pm
Reply with quote

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
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Fri Oct 19, 2007 3:34 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Oct 19, 2007 5:03 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 7:24 pm
Reply with quote

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
View user's profile Send private message
vijay singh chouhan

New User


Joined: 19 Oct 2007
Posts: 22
Location: mumbai

PostPosted: Fri Oct 19, 2007 7:46 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 7:56 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL with variables JCL & VSAM 1
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts JCL Variables JCL & VSAM 1
Search our Forums:

Back to Top