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
what is the difference between COBOL2 AND COBOL390?
Write a program to explain size error.
What is the LINKAGE SECTION used in COBOL?
What is Pic 9v99 Indicates in COBOL?
How to know whether the module is dynamical or statistical?
Give some examples of command terminators?
What rules are followed by the search verb.
) How do u handle errors in BMS macro
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
What is the difference between comp and comp-3 usage?
Explain what you understand by passing by value.
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What is link edit in cobol?
What is the utilization of copybook in cobol?