Without using move verb how to move one variable to another.
Answer Posted / raju
Let the variables and their values be A = 20 and B = 30
and we need to swap them as A = 30 and B = 20 without MOVE statement
BEFORE AFTER
A B A B
Way 1: COMPUTE A = A+B 20 30 50 30
COMPUTE B = A-B 50 30 50 20
COMPUTE A = A-B 50 20 30 20
Way 2: COMPUTE A = A*B 20 30 600 30
COMPUTE B = A/B 600 30 600 20
COMPUTE A = A/B 600 20 30 20
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
How do you get the data to code the BMS macro?
What rules are followed by the search verb.
What are the pertinent COBOL
Write the code to count the sum of n natural numbers.
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
Can we change the password using ALTER? anyone tried and changed?
What is the difference between next sentence and continue in cobol programing language?
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?
What are 77 levels used for?
What is amode(31)
What is a report item?
Discuss about changing dataset name in proc.
what is the use of outrecord?
How you can characterize tables in cobol?