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

What is the default value(s) for an initialize and what keyword allows for an override of the default?

686


i want a program using by if, evaluate , string, unstring, perform, occurs?

4037


What are the different rules for performing sort operation?

753


What is the Purpose of Pointer in the string?

636


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.

922






Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2046


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10544


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)?

619


When is inspect verb is used in cobol?

669


what are decleratives in cobol?

1821


What are different data types in cobol?

678


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

616


How do define dynamic array in cobol.

664


How do you get the data to code the BMS macro?

1470


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

985