I would open two sessions and use DSPUSRPRF to compare the 2 user profiles to see if there are any differences.
Also need to check object authority to see if that is a problem.
How are you doing this? With STRSQL? RUNSQL? RUNSQLSTM?
You said the *LIBL seem to be the same. Just to get past that,, try your SQL with hard coding the library name.
The winner is Tom, again. Thank you.
*SYN was set on the session that would not work correctly.
*SYN The SQL statement is syntax checked only. Syntax
checking is done according to DB2 UDB for i5/OS syntax
rules. A statement that passes the syntax check on
the System i may not run on a remote system.
I don’t know how it got that way but I changed to *run and everything seems ok.