Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Is it acceptable to have the same value in the array more than one time?
If this is not valid, how is the array populated? As the array is being populated, the code could look at the previous entries in the array and determine if this is a "new" value or is it is already in the array.
If you post more detail on your requirement, we will be able to offer better suggestonis.
I have an array of 100 records. I want to know how many times a particular value has repeated in the array
You can do it using search verb also.
01 I pic 9(3).
01 temp pic 9(3) value '1'.
01 tab1 occurs 100 times indexed by I.
05 val pic x(20).
move temp to I.
search tab1 at end go to para-exit
when val(I) not = 'bala'
set I up by 1.
if (I <= 100)
move I to temp
add 1 to counter
go to para-1