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 |
What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?
What is the figurative constant in cobol?
i want to store 20 digits . h will u do it in cobol ?
How to increase the logical record length of existing PS file?
How many sections are there in data division in COBOL?
When would you use in-line perform?
What are the different data types available in COBOL?
What are the differences bitween cobol and cobol-2?
How do define dynamic array in cobol.
How do you reference the fixed block file formats from cobol programs
whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?
level number 77 is used to define a)group data b)elementary data c)redefine d)none