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
What is the difference between Call and a Link?
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?
What are the various section in data division and briefly explain them.
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Why would you use find and get rather than to obtain?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Write some characteristics of cobol as means of business language.
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
What are the different rules to perform a Search?
How you can read the file from bottom?
What is the difference between perform … with test after and perform … with test before?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How do define dynamic array in cobol.
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
) How do u handle errors in BMS macro