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


Please Help Members By Posting Answers For Below Questions

What is difference between static and dynamic call in cobol?

793


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5392


How to remove 2 duplicate records and copy only one using job control language?

763


Explain how to differentiate call by context by comparing it to other calls?

695


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1126






What are the different rules to perform a Search?

625


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

693


Write a program to enter and display the names of students in a class using the occurs clause.

663


What are all the divisions of a COBOL program?

667


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1034


What is redefines clause in COBOL?

855


How to know whether the module is dynamical or statistical?

670


How do define dynamic array in cobol.

682


What is the difference between PIC 9.99 and PIC9v99?

791


What are the cobol coding sheets?

673