ready for sql ? uses an embedded SET statement.
prefer internal table ? use a lokup opcode
You don’t say what OS version/release you have. Assuming it’s at least V5, just write a small COBOL procedure. Bind it with your RPG into a single program object.
That’s a major point to the whole ILE concept. Write routines in whatever language is appropriate. They can all be bound together into single program objects.
And if you have RPG, the same license works for COBOL (and C or C++). Just load the COBOL compiler.
If you also have a SQL Dev Kit license, it applies to all languages too. This makes the COBOL unnecessary though, because as JPLamontre noted, a simple SQL statements can perform IN() tests.