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.
Answers were Sorted based on User's Feedback
Answer / lu
you write like this :
01 Copybook1.
02 ADDRESS pic x(03).
01 Copybook2.
02 ADDRESS pic x(03).
move 'AAA' to ADDRESS OF copybook1
move 'BBB' to Address OF copybook2
never forget the 'OF'
| Is This Answer Correct ? | 17 Yes | 1 No |
Answer / arpan
Or we can use replace option with the copybook in the COBOl
PGM.
For e.g..
Copy Copybook1.
Copy Copybook2 replacing ADDRESS with ADDRESS1.
Correct me if I am wrong.
| Is This Answer Correct ? | 9 Yes | 2 No |
Answer / 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 |
1.Can we define condition-name conditions in FD entry.
tell me about examine inspect and evaluate ?
consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable
Whats the use of Examine command? can someone help me?
how to convert vsam table into DB2 table?
how to display the dataset information?
) How do you access the migrate the data from production region to development region
What is cobol?
1) can we display the index?
HOw can I get the negative sign while deduct high value from low value
can anyone explain me the concept of COMP-4 PLEASE??
input:-AABBCCDDEFGHIIJ output:- ABCDEFGHIJ Here in input we hav the duplicate characters i.e repeating characters.SO we should eliminate the duplicate characters and should display the output in ascending order.