I need to check if RACF ID is having acces to a file.If we want to work on some production data set ,first I need to check if the RACF ID has access to that file ,Only then i need to allow the user to proceed further.
I tried below,which I found while searching.But it is not giving me correct result.When i tried with a qualifier for which i did not have access ,even then it is giving as SCN ACCESS THE FILE.
ADDRESS ISPEXEC "LMINIT DATAID(DATAID) DATASET('"DSN"')"
ADDRESS ISPEXEC "LMOPEN DATAID("DATAID") OPTION(INPUT)"
IF RC = 8 THEN
SAY 'AUTHORIZATION REQUIRED'
ELSE
SAY'CAN ACCESS THE FILE'
ADDRESS ISPEXEC "LMOPEN DATAID("DATAID") OPTION(INPUT)"
IF RC = 8 THEN
SAY 'AUTHORIZATION REQUIRED'
ELSE
SAY'CAN ACCESS THE FILE'
Please guide me on how to chk for the access.
Thank You