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
What is redefines clause in COBOL?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
What is the difference between a binary search and a sequential search what are the pertinent cobol?
Name the divisions, which are available in a cobol program?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
What is rmode(any) ?
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 ......
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?
i want a program using by if, evaluate , string, unstring, perform, occurs?
What rules are followed by the search verb.
what is the use of outrecord?
What rules are to be followed while using the corresponding options?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What are the different rules to perform a Search?
How to know whether the module is dynamical or statistical?