If there are two copybooks which have same variables and we
are using both the copybooks in our program. will there be
an error and if i move values to the variable which copybook
varibales gets the values i move in.

Answer Posted / jagan

There won't be any error if we have similar variables in
different copybooks and use them in a same program. One
thing i would like to ensure here is before using a copybook
variable in a program , you will need to mention the name of
the copybook followed by the variable...
eg., there are 2 copybooks. RESIDENT and OFFICE and both
of them have the variable ADDRESS in it .


(i) RESIDENT
(ii) OFFICE

We need to refer them in the program by


RESIDENT-ADDRESS and OFFICE-ADDRESS.

In case any data is to be moved to these fields then you can
do it by below stmts.

MOVE PERM-ADD TO RESIDENT-ADDRESS
MOVE TEMP-ADD TO OFFICE-ADDRESS

Hence there shouldn't be any problem in referring to similar
fields in different copybooks .

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do get the result of your program directly on your pc?

2067


Name some of the examples of COBOl 11?

2880


What kind of error is trapped by on size error option?

953


What is an in line perform? When would you use it? Anything else you wish to say about it.

836


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

982


what happens if parmparameter passes zero bytes to the program

1877


What is the local-storage section?

886


Explain what you understand by passing by value.

909


What is report-item in COBOL?

894


In COBOL programming, what is PERFORM? What is VARYING?

866


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2126


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1163


For rewrite, why is it mandatory that file needs to be opened?

834


Can we change the password using ALTER? anyone tried and changed?

1742


What is link edit in cobol?

941