How to check for access of file in REXX



IBM's Command List programming language & Restructured Extended Executor

How to check for access of file in REXX

Postby Mann_B » Tue Jan 03, 2012 2:49 pm

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
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to check for access of file in REXX

Postby enrico-sorichetti » Tue Jan 03, 2012 10:09 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: How to check for access of file in REXX

Postby Pedro » Sat Jan 07, 2012 4:57 am

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"   
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post