How To Separate The Numerics From An Alphanumric Data Item
Which Contains Both Alphabates And Numerics ?
Answer Posted / 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 |
Post New Answer View All Answers
HOw can I get the negative sign while deduct high value from low value
For rewrite, why is it mandatory that file needs to be opened?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
How do get the result of your program directly on your pc?
What is redefines clause in COBOL?
What are the different rules for performing sort operation?
What is the LINKAGE SECTION used in COBOL?
What is the difference between binary search and sequential search?
What is the difference between comp and comp-3 usage?
What is the problem of ordered sequential files access?
Explain what you understand by passing by value.
What is the difference between comp and comp-3?
how do you reference the esds vsam file formats from cobol programs
how do you reference the fixed unblock file formats from cobol programs