Category: <span>FAQs and Tips</span>

Q. I understand how to prototype a program call, using EXTPGM and naming the program. But I want to allow the user to select an item from a subfile, then have the program use that selection to choose one from among several different possible programs to run. Is there a way to do this?

Q. I have an interface program that has several single position character fields. Each field had has eight sub fields (each bit has a different meaning). In my old thinking I would have used TESTB and tested each bit assigning a different indicator per bit:

Q: When I try the following operation:

eval %subarr(*in:50:5) = '00000';

I get the following compile error: “The expression is not valid for assignment to an indicator or indicator data structure.” I get the same error when I try it without the 3rd parameter as

eval %subarr(*in:50) = '00000';

Q. We use a trigger program written by a former employee; it has started getting decimal data errors (RNQ0907 or MCH1202). My company recently upgraded to Version 5, but the program was working perfectly before that. No one here really understands triggers. Can you give me an example of an RPG IV trigger program that will work?