I'm trying to figure out how to search multiple occurrences of an array for common values using RPGLE, and so far have been unsuccessful. What I'm trying to do, is find out how many arrays share the same common values. Each array is 1 long, with an array length up to 100. For example:
Array 1 = 'a' 'b' 'c' 'd' 'e' 'f' ' ' ' '.....
Array 2 = 'a' 'b' 'c' 'd' 'e' 'g' ' ' ' '.....
Array 3 = 'd' 'c' 'a' 'b' 'h' 'e' ' ' ' '.....
Array 4 = 'k' 'b' 'e' 'd' 'a' 'g' ' ' ' '.....
I'm trying to find an easy way to determine that the letters a, b, d, & e are all common between the arrays, or each of those letters are shared between the arrays.
Does anyone have any idea how to do this search easily, so I don't have to end up in nested do's and if's hell? It gets pretty hairy when all 100 elements of an array are filled out. However, some good news is that there are only 10 arrays that can be filled out.
Thanks in advance!