How To Separate The Numerics From An Alphanumric Data Item
Which Contains Both Alphabates And Numerics ?
Answer Posted / 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 |
Post New Answer View All Answers
What are all the divisions of a COBOL program?
In COBOL programming, what is PERFORM? What is VARYING?
What is difference between static and dynamic call in cobol?
what happens if parmparameter passes zero bytes to the program
A table has two indexes defined. Which one will be used by the SEARCH?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
What is a scope terminator give example?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Can we redefine the field of x(200) to less than 200?
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
Which mode is used to operate the sequential file?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
) How do u handle errors in BMS macro?