How To Separate The Numerics From An Alphanumric Data Item
Which Contains Both Alphabates And Numerics ?
Answers were Sorted based on User's Feedback
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 |
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 |
Which division and paragraphs are mandatory for a COBOL program?
What is a report item?
Explain what you understand by passing by value.
In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?
what is index and how to use two tables using index?
without performing any operations on a file how can i know whether it contains data or not
Differentiate COBOL and COBOL-II?
i Want All cobol ERROR codes?
how many bytes does s9(7)COMP-3 field occupies?
Can we access the a[0] in the array ?
Write a program that uses move corresponding.