How To Separate The Numerics From An Alphanumric Data Item
Which Contains Both Alphabates And Numerics ?

Answers were Sorted based on User's Feedback



How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Nume..

Answer / shriram supalwar, dharmabad

01 A pic x(10) value 'a1b2c34d5e'.
01 B pic x(5).
(You want to move only numeric data from a to b)

PERFORM PARA1 VARYING I FROM 1 BY 1 UNTIL I>10
PARA1.
IF A(I:1) IS NUMERIC
MOVE A(I:1) TO B(I:1)
END-IF
END-PERFORM.
DISPLAY "NUMERIC DATA IS:" B(I).

Is This Answer Correct ?    12 Yes 0 No

How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Nume..

Answer / harsha

Use COBOL program and check byte by byte.

Is This Answer Correct ?    9 Yes 0 No

How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Nume..

Answer / kingmanish

Use the COBOL keyword ISNUMERIC.

This would be evaluated to true if the value stored is
numeric and you can separate the numeric values

Is This Answer Correct ?    2 Yes 1 No

How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Nume..

Answer / reddy

use Function NUMVAL

Is This Answer Correct ?    4 Yes 8 No

Post New Answer

More COBOL Interview Questions

How you can delete a record from a ps file in cobol?

1 Answers  


is it mandatory to give data division before procedure division ? wht happens if i give procedure division first thn data division ? reply soon

2 Answers   Patni,


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

0 Answers  


How can we pass data from cobol to JCl?

7 Answers   ADP, Amdocs, IBM,


What is LENGTH in COBOL II?

2 Answers   CSC,






wht is the use of evalute verb ? how do u declare recfm in cobol and jcl ?

2 Answers   EDS,


i am a btech cs 2009 passout. i am opting for mainframe course. is it good to do this course? pls. anyone suggest me

4 Answers  


Hi All, how is sign is stored in S9(17) comp-3 variable. Answer with an Example will be of great help.

5 Answers   EDS,


What is the significance of 'above the line' and 'below the line'?

2 Answers   Nokia,


Define static linking and dynamic linking.

0 Answers  


can we print comp 3 stmts how ?

3 Answers   Accenture, TCS,


What is SDSF?

3 Answers  


Categories