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 |
write a program to eliminate duplicate records in a input file and send them to output file.THIS IS IGATE RECENT QUESTIONN.....JUST 1 WEEK BACKKKK...
how to convert the recors form vsam file to db2 table tru file aid
A table has two indexes defined. Which one will be used by the SEARCH?
Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
6 Answers ABC, IBM, Mphasis, Wipro,
88 level entry is used for (a) data items in WORKING-STORAGE SECTION (b) items with RENAMES clause (c) condition-names (d) None of the above
wht is structured cobol pgm and non structred cobol pgm ?
whats the difference between search and search all?
What is the significance of the PROGRAM-ID paragraph? If this name doesnt match with the name of the COBOL program, does it make a difference? Is the name specified in the PROGRAM-ID paragraph used as a name for the load module or any such thing?
created cluster using IDCAMS ..that is empty ..when i write a program for read using Input ..wil it open the cluster or gives any error?
hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?
How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?
what is the purpose of linkage section?