I have a similar function with similar restrictions (for those same reasons). Minimal benefit to being the pioneer who first implements a better process (I like learning new/better methods but tough to do when we’re SO busy).
I set up a PF to contain the results (html plus other fields used by the email creation routine that runs on the PC network). I used a large field size (multiple 512 char fields) and populate the content from a compile time table in the RPG pgms (so can use as many array elements as needed & concatinate to form full fields). This works well for my application because the html content rarely changes (when it does then it’s a program change).