Page 1 of 1

How to check for access of file in REXX

PostPosted: Tue Jan 03, 2012 2:49 pm
by Mann_B
Hi

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'     



Please guide me on how to chk for the access.

Thank You

Re: How to check for access of file in REXX

PostPosted: Tue Jan 03, 2012 10:09 pm
by enrico-sorichetti
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.

why the need check...
if the security environment has been just decently setup a checking will result anyway in a security violation
just forget about it and just handle the open error

there is something flaky in Your test environment...
I just checked myself and an LMOPEN without authorization returns a RC 8

Re: How to check for access of file in REXX

PostPosted: Sat Jan 07, 2012 4:57 am
by Pedro
need to check if RACF ID is having acces to a file


There are various levels of access. Perhaps you have READ authority but not UPDATE authority.

You can use the LISTDSD command to determine if you have access.
Address TSO "LD DA("dsname")   ALL"   

You will need to check return code the command response text. and you might have to followup with
Address TSO "LD DA("dsname")   GEN"