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
How do u write test cases?
How do you differentiate between cobol and cobol-ii?
Which division and paragraphs are mandatory for a COBOL program?
Explain what you understand by passing by value.
How do get the result of your program directly on your pc?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
How to remove 2 duplicate records and copy only one using job control language?
Define cobol?
What rules are followed by the search verb.
how do you reference the variable unblock file formats from cobol programs
Difference between array and sub-script ?
Write a program to explain size error.
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Write a program that uses move corresponding.
What is redefines clause in COBOL?