debug your sql with Sql Visual Explain, it’s a tool provided with operation navigator. details ? look at http://jplamontre.free.fr/AS400/RTVSQL.htm and http://jplamontre.free.fr/AS400/SqlExplain.htm
Ripping out the SQL and replacing with native RLA will almost certainly make things slower, so why even consider it? Of course, that assumes that SQL is being used appropriately in the first place. If it’s not focused on “set at a time” operations, then the reason it’s slow is because it’s not being used correctly.
If it is being used correctly, then you’re going to make things slower after wasting a lot of programming time and effort. Doesn’t make much sense to me even to consider it in that case.