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 |
What does EXIT do ?
What is the difference between COMP & COMP-3 ?
I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...
what is difference between the sysabend and userabend?
is it possible to pass an SQL query inside a jcl which is inside a cobol program?
wht is the use of evalute verb ? how do u declare recfm in cobol and jcl ?
file status 00 is checked after opening the file or reading the file
how will u retreive value from a table.write it with syntex. 01 ws-table 05 ws-table1 occurs 10 times. 05 ws-table2 occurs 10 times. the above is 2 dimensional array..how will u retrieve 1st element of an array
how we rectify soc4 and soc7 error in project(need real time answer)? please reply
Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?
) How do you access the migrate the data from production region to development region