How can I find if a specific column is part of a key?

Document ID : KB000098225
Last Modified Date : 28/05/2018
Show Technical Document Details
Question:
We need to identify whether a field is part of a key / index   from a table. 
I like to get that information by running an SQL query.
How can I do that? 
Environment:
z/OS 
CA Datacom 15.1
Answer:
You can run this SQL query:

SELECT RECORD_NAME , AUTHID , AGR_SQLNAME , DATACOM_NAME, DATACOM_ID FROM SYSADM.KEY
WHERE ENABLE = 'Y' AND STATUS = 'P' AND KEY_TYPE = 'I' AND
RECORD_NAME = 'your record name' AND ( KY1FLDNM = 'your  field' OR KY2FLDNM = 'your field' OR KY3FLDNM = 'your  field' OR KY4FLDNM = 'your field')

DATACOM_NAME is the name of the key.