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 |
Why there is no questions in this column?
What is the point of the REPLACING option of a copy statement?
how to fetch the record before the last record in a cobol file( its a huge file and if the key field is not known)
what are the steps to sort in a cobol program?
how many maximum no of variables can be declared in linkage section ?
Can the OCCURS clause be at the 01 level?
I have dataset DS1 which has records say 1 2 3 4 5 ... ... etc And also I have second dataset DS2 whcih has records 1 3 4 5 6 8 .. ... Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.
what is difference between cobol and cobol/400
I know my query will return more than one row but I don't want cursor what should I do?
What is the significance of 'above the line' and 'below the line'?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
What is link edit in cobol?