I'm having an issue with an SQL select statement. I have a job that run this query:
SELECT A.CTRYNUM, A.CUSTOMER_NO FROM XXXX.AAA A, YYYY.BBB B WHERE A.LAST_UPT_ID = 'AUOCUST' AND A.CTRYNUM = B.CTY;
The job is failing because the user doesn't have authorization to select in table XXXX.AAA. I checked the authorization in SYSTABAUTH table and I see that group MYTEAM has the authorization to perform select statement in table XXXX.AAA. Then I checked the RACF to see the user that belongs to this group and the user I'm using is in this group so it should have authorization to perform the query. I tried to run these two queries and I get the same error (SQLCODE = -551, ERROR: PC2 DOES NOT HAVE THE PRIVILEGE TO PERFORM OBJECT XXXX.AAA).
SELECT A.CTRYNUM, A.CUSTOMER_NO FROM XXXX.AAA A WHERE A.LAST_UPT_ID = 'AUOCUST';
SELECT * FROM XXXX.AAA A;
Something that is weird is that I run the same job with user PC1 and it run OK. Users PC1 and PC2 belongs to the same group that has access to select on the table.
I don't know why it works with user PC1 and it doesn't with user PC2 when both belongs to the same group. Please, do you have any idea of this?