Why is it harder to edit the program than to edit the %LET statement?
Unless you are talking about generating the code from source table. In that case you need show us the source table and explain the rules for generating the code. Personally I find that complex code generation is easier to do by using a data step to write the code to a text file. You can then use %INCLUDE to execute the code you generated.