how do you move only numeric data from A to B
01 A pic x(10) value 'a1b2c34d5e'.
01 B pic x(5).

Answers were Sorted based on User's Feedback



how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pi..

Answer / ravi krian j

using reference modification move & isnumeric


PERFORM VARYING I FROM 1 BY 1 UNTIL I>10

IF A(I:1) IS NUMERIC
MOVE A(I:1) TO B(I:1)
END-IF
END-PERFORM.

Is This Answer Correct ?    19 Yes 1 No

how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pi..

Answer / mr.s

using inspect command

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More COBOL Interview Questions

What is amode(31)

0 Answers  


How to execute a set of JCL statements from a COBOL program?

2 Answers   Patni, Syntel,


What is the different between index and subscript?

3 Answers  


What is a scope terminator give example?

0 Answers  


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

0 Answers  






Can the OCCURS clause be at the 01 level?

2 Answers  


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

0 Answers   HCL,


can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move 'xy' to b. display a,b.

10 Answers   IBM,


what is subscript in cobol?give realtime example?

2 Answers   Wipro,


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

0 Answers  


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

0 Answers  


what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


Categories