Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Without using move verb how to move one variable to another.

Answers were Sorted based on User's Feedback



Without using move verb how to move one variable to another...

Answer / sudha

01 A PIC 9.
01 B PIC 9.

Compute A = B.

Is This Answer Correct ?    25 Yes 2 No

Without using move verb how to move one variable to another...

Answer / bala

We can do this in multiple ways.
1) Using UNSTRING
2) COMPUTE
3) Also, REFERENCE MODIFICATION i.e, if XYZ is a variable with value 'all interview' then
A = XYZ(1:3) moves the first 3 characters of XYZ variable to A.
i.e, A value will be 'all'

Is This Answer Correct ?    8 Yes 2 No

Without using move verb how to move one variable to another...

Answer / monick

SET A TO B

Is This Answer Correct ?    11 Yes 6 No

Without using move verb how to move one variable to another...

Answer / manikandesvaran

1)Using REDEFINES you can acheive this.

For ex.
10 WS-OLD-START-DATE PIC 9(8).

10 WS-NEW-START-DATE REDEFINES WS-OLD-START-DATE.
15 WS-START-YEAR PIC 9(4).
15 WS-START-MONTH PIC 9(2).
15 WS-START-DAY PIC 9(2).

Now WS-NEW-START-DATE will hold the value of WS-OLD-START-
DATE.

2)Using UNSTRING operator.

UNSTRING WS-NEW INTO WS-OLD

3)Using COMPUTE verb.

COMPUTE WS-NEW = WS-OLD.

4)Using SET statement.

SET OLD to NEW.

Is This Answer Correct ?    5 Yes 1 No

Without using move verb how to move one variable to another...

Answer / 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

More COBOL Interview Questions

A paragraph PARA-X is to be executed when none of the data names A, B and C have value of 1. Which of the following will achieve this ? (a) IF A NOT = 1 OR B NOT = 1 OR C NOT = 1 PERFORM PARA-X (B) IF NOT A= 1 AND B= 1 AND C = 1 PERFORM PARA-X (C) IF A NOT =1 IF NOT B = 1 OR C= 1 PERFORM PARA-X (C) IF A NOT = 1 AND B NOT = 1 AND C NOT = 1 PERFORM PARA-X

3 Answers   TCS,


What is the difference between PIC 9.99 and 9v99 in COBOL?

0 Answers   SwanSoft Technologies,


When would you use in-line perform?

2 Answers  


How to read the last 100 records from a COBOL file. The file contains N number of records.

11 Answers   IBM,


what happens when a copybook variables are declared using include statement ?

3 Answers   IBM,


there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it

3 Answers   TCS,


Suppose i want to declare a binary comp fild of 7 byte .how to write?

6 Answers   IBM,


What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?

4 Answers  


i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk values pls say how to do ths reply fast

4 Answers   L&T,


2)Where the Plan is located in CICS-DB2?

1 Answers   IBM,


How can you declare the file ?

1 Answers   Wipro,


How to use the same COBOL program in Batch and CICS on lines? explain with an example

0 Answers   IBM,


Categories