That since the access path of the OPNQRY FILE is being shared, the CPYFRMQRYF commnad isreading it to end of file, and that is where the RPG program starts. Is there a need to perform the CPYFRMQRYF? Could the RPG program be modified to read that file instead? You can verify this by simply commenting out the CPYFRMQRYF and see if the RPG program gets data this time. Then figure out how to redesign the app. Good luck!