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

Why did you choose to work with ibm mainframe cobol programming?

627


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

695


Are you comfortable in cobol or jcl?

639


Write a program to explain size error.

669


What rules are followed by the search verb.

631






What is the difference between binary search and sequential search?

636


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

734


What are the pertinent COBOL

2041


What is the difference between Call and a Link?

694


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

624


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2727


What is the difference between next sentence and continue in cobol programing language?

705


) How do u handle errors in BMS macro?

1423


Explain how to differentiate call by context by comparing it to other calls?

683


how to access the file from prodution from changeman tool and to submit a file to production

6678