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 |
how to pass 100 to s9(4) how r they inserted ?
What are the various section in data division and briefly explain them.
1.What is the default print format in cobol?
What is difference between comp & comp-4?
what is MSGLEVEL?
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
Explain how to differentiate call by context by comparing it to other calls?
What are ISOLATION LEVELS? Where do we need to specify them in compiling JCL (Exactly which statement and what is syntax for it)?
Are you comfortable in cobol or jcl?
Can we use redefine clause in occurs clause?
for an INITIALIZE and what keyword allows for an override of the default.
I want ALL ERROR codes in VSAM
3 Answers American Express, TCS,