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
Can you please let me know the centre name of INS certification in Kolkata.
What is the usage of comp fields in cobol?
Define static linking and dynamic linking.
Explain about different table spaces.
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
Write a program to explain size error.
what is search and searchall?what is the diffrence between them?give an best example?
What are the access modes of START statement?
How many sections are there in data division in COBOL?
What is the use of intialize verb?
how do you reference the variable unblock file formats from cobol programs
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
how can i see junk values in dclgen or in hostvariable of comp ?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?