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
 

 

Addiing variables in linkage section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Addiing variables in linkage section
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: 1439
Location: Bangalore,India

PostPosted: Fri Oct 19, 2007 2:45 pm    Post subject:
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    Post subject:
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: 95
Location: India

PostPosted: Fri Oct 19, 2007 2:59 pm    Post subject: Reply to: variable in linkage section
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: 1439
Location: Bangalore,India

PostPosted: Fri Oct 19, 2007 3:01 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Fri Oct 19, 2007 3:24 pm    Post subject:
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: 95
Location: India

PostPosted: Fri Oct 19, 2007 3:34 pm    Post subject: Reply to: variable in linkage section
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Fri Oct 19, 2007 5:03 pm    Post subject: Reply to: variable in linkage section
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

Site Director


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

PostPosted: Fri Oct 19, 2007 7:24 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Oct 19, 2007 7:56 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm


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