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 difference between static and dynamic call in cobol?
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?
How to remove 2 duplicate records and copy only one using job control language?
Explain how to differentiate call by context by comparing it to other calls?
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.
What are the different rules to perform a Search?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Write a program to enter and display the names of students in a class using the occurs clause.
What are all the divisions of a COBOL program?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
What is redefines clause in COBOL?
How to know whether the module is dynamical or statistical?
How do define dynamic array in cobol.
What is the difference between PIC 9.99 and PIC9v99?
What are the cobol coding sheets?