How QUERY SECURITY works

How QUERY SECURITY works depends on:
Note: QUERY SECURITY is not affected by the RESSEC and CMDSEC keywords on the transaction definition.
There are two distinct forms of the QUERY SECURITY command, depending on the options chosen.