Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are
the ways for doing this?

Answers were Sorted based on User's Feedback



Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / jayaprabhu

hi all

Numeric can be moved to alphanumeric
and alphanumeric can be moved to numeric only if it has the
numeric data.

Is This Answer Correct ?    41 Yes 10 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / sivakumar sekharannair

Chakri and kavya are correct.We can move numeric to
alphanumeric and vice versa. error will be thrown only when
we do arithmetic operations when we move alpha numeric to
numeric data items .

Is This Answer Correct ?    20 Yes 1 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / jawaad

yes you can do both , but wait....

1) 9(9) to x(9) will be fine

2) x(9) to 9(9) may have problem in some cases:-

a) Suppose :x(9) has value "5"
when you move to 9(9) it will be
"5 " ,Yes 9(9) will have spaces
instead of
"000000005"
b)you will get soc7 when you perform arithemetic on x(9)
above

Is This Answer Correct ?    10 Yes 3 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / varun v

yes you can..use REDEFINES for the same purpose.

Move X(9) to 9(9):-

Working storage section:-
01 WS-VARX PIC X(9) VALUE SPACES.
01 WS-VARN REDEFINES WS-VARX PIC 9(9).

Now you can move X(9) variable to WS-VARX.Eventually it is
moved to the 9(9) variable WS-VARN.

Similarly viceversa..

Is This Answer Correct ?    18 Yes 12 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / kavya

Hello sir,
Why can't we move from alphanumeric to numeric.We
can.JUst check it out.

Is This Answer Correct ?    8 Yes 3 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / chakri

kavya is right. We can move numeric to alphanumeric and
vice versa. error will be thrown only when we do arithmetic
operations when we move alpha numeric to numeric data
items .

Is This Answer Correct ?    8 Yes 3 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / sp

Fully agree to Jayaprabhu.
We can move 9(9) to X(9). But if alphanumeric field
contains only numeric then and then we can move X(9) to 9
(9).

Is This Answer Correct ?    5 Yes 0 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / ajay

Sorry ..
I don't know why you are looking into Redefines clause for
the above ...
See what ever it is you can able to move from NUMERIC to
ALPHANUMERIC.But you can not able to move alphanumerics to
NUMERIC.
Move 9(9) to x(9) --possible
Move x(9) to 9(9) -- Not possible.
They may try to confuse you ... but don't give a chance to
them Thanks.

Is This Answer Correct ?    12 Yes 8 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / leena_kulkarni

Hey varun,
thanx for the answer but do you know the other way than
REDEFINES? Actually I was looking for that.

Is This Answer Correct ?    2 Yes 3 No

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?..

Answer / harish

Hi,

i hope ajay's answer is correct,but if by moving we will
not get any error .suppose if we use recieved field in any
operation we will get soc07 ..

pls correct me if anything wrong

HARISH POOMGAME SHIVAPPA
NIIT TECHNOLOGY
KOLKATA

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More COBOL Interview Questions

what is the result of the following? DIVIDE A INTO B GIVING C. a.C=A/B b.the reminder of B/A is stored in C c.C=B/A d.the reminder of A/B is stored in C

3 Answers   TCS,


How to covert given string into ASCII value in COBOL/MF COBOL

3 Answers   CTS, IBM, iFlex,


Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,


wht is packed decimal in cobol

2 Answers  


What are the rules of the move verb?

0 Answers  






i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

0 Answers  


If we use GO BACK instead of STOP RUN in cobol?

1 Answers   Temenos,


What is 66 level number and where it is used in real time by software developers?

2 Answers   ITC Indian Tobacco Company, TCS,


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


Can you please let me know the centre name of INS certification in Kolkata.

0 Answers  


give the examples for strings and unstrings in cobol

2 Answers   IBM,


I have a seq file with different fields one field is address with pic x(50) as input in a cobol program. In address there is 'PUNE' at any different positions in the address field ( form 1 t0 50) . My requirement is select the fields with address 'PUNE' by using cobol. Please suggest

2 Answers   IBM,


Categories