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 |
can we write paragraph in area B .....
01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access the second name
Name the sections present in data division.
What does the INITIALIZE verb do?
What is an in line perform? When would you use it? Anything else you wish to say about it.
Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???
What is difference between static and dynamic call in cobol?
01 a pic 9(9v99) 01 b pic 9(9.99) wht will be the stored vales in both cases
How to define a array dynamically.....
In a program, variables are used but no DB2 involved in it. Can you call it as host variables??
01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?