IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

check the access to a pds using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
soumyanamboo

New User


Joined: 16 Apr 2008
Posts: 13
Location: Chennai

PostPosted: Thu Apr 24, 2008 1:04 pm
Reply with quote

please tell me how to check access to a PDS using REXX. i saw one prev post, asking to do the following.
Quote:
"try to access it and see what you get for an error. Then code for that error. . "

i am getting the following error.

ICH408I USER(U133598 ) GROUP(AJD25910) NAME(SOUMYA )
U168551.CICS.PGMS CL(DATASET ) VOL(LPRJ15)
INSUFFICIENT ACCESS AUTHORITY
FROM U168551.** (G)
ACCESS INTENT(READ ) ACCESS ALLOWED(NONE )
IEC150I 913-38,IFG0194E,U133598,IKJUSER,SYS00574,E427,LPRJ15,U168551.CICS.PGMS
MEMBERS :
IKJ58514I DATA SET 'U168551.CICS.PGMS' NOT USEABLE+
IKJ58514I OPEN ERROR CODE 913

please tell me how to handle this error using REXX program [/quote]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Apr 24, 2008 1:27 pm
Reply with quote

why don' t You run a sstupid test and look at the execio return code ??

a three liner would be enough
Code:
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace  "I"
Address TSO "ALLOC FI(SYSUT1) DA('any_protected_dsname') SHR REUSE"
Address TSO "EXECIO * DISKR SYSUT1 ( FINIS STEM DATA."


sorry a four liner
Back to top
View user's profile Send private message
soumyanamboo

New User


Joined: 16 Apr 2008
Posts: 13
Location: Chennai

PostPosted: Thu Apr 24, 2008 3:31 pm
Reply with quote

sorry, i have to verify the access to a PDS.
for using the above mentioned code, first i need to get any of the member of this PDS. how can i get the member in the PDS if i don't have access to that. i am getting a syntax error here, that "The input or output file SYSUT1 is associated with a partitioned dataset. A member name must be specified."
please help
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Apr 24, 2008 6:24 pm
Reply with quote

Ok I just made a generic sample...

anyway the point is that when You try to access a dataset for wich You dop not have the permission
the fact will be passed to the command invoked, usually with a high return code

in the example posted the return code was 20

You could treat as a generic system failure and tell the user to contact support...

anyway if the user insists the security audir people will get in touch with him/her

retested using a 'dataset(member)' and th rc was still 20
what are You usingto get the members list ??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Apr 24, 2008 8:40 pm
Reply with quote

Hello,

Quote:
A member name must be specified
So, use a "fake" member name and see what error is thrown. Then, proceed from there.
Back to top
View user's profile Send private message
soumyanamboo

New User


Joined: 16 Apr 2008
Posts: 13
Location: Chennai

PostPosted: Wed Apr 30, 2008 3:28 pm
Reply with quote

hi,
Quote:
use a "fake" member name and see what error is thrown

When i tried to put a fake member name
I am getting "System abend code 013, reason code 00000024".
ie The system could not OPEN one of your datasets properly, generally because of an incorrect DCB parameter (BLKSIZE), or it could not find the specified member of a partitioned dataset
Hence that option also will not work
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Apr 30, 2008 3:52 pm
Reply with quote

Hi !

So create a normaly-not-used member there and use this for the allocation test, enrico showed you.

MemberName could be $$$COIBM. Perhaps it's already there.

Regards, UmeySan
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Apr 30, 2008 6:09 pm
Reply with quote

You can even use the following code snippet for verifying the access

ADDRESS ISPEXEC "LMINIT DATAID(dataid) DATASET('"YOUR DATSET"')"
ADDRESS ISPEXEC "LMOPEN DATAID("dataid") OPTION(INPUT)"

IF RC = 8 THEN SAY 'AUTHORIZATION REQUIRED'
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Apr 30, 2008 8:50 pm
Reply with quote

Hello,

Quote:
I am getting "System abend code 013, reason code 00000024".
Yup, an 013-24 surely means a "member not found".

I'm surprised that the system checked for the member before authorization to access the dataset was checked.

Does anyone know if that is "a feature"?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Apr 30, 2008 10:39 pm
Reply with quote

I might be wrong...
but IIRC authorization checking comes after dataset checking
and then can ask racf to check the dataset profile

a dataset of the form "pdsname(membername)" follows the rules of a PS dataset
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Apr 30, 2008 11:42 pm
Reply with quote

Hi Enrico,

Quote:
authorization checking comes after dataset checking
and then can ask racf to check the dataset profile

a dataset of the form "pdsname(membername)" follows the rules of a PS dataset
Thanks for the clarification.

As i'm (most often) one of the holders of the "keys to the kingdom", i've not been concerned with which checking might come first icon_cool.gif

d
Back to top
View user's profile Send private message
soumyanamboo

New User


Joined: 16 Apr 2008
Posts: 13
Location: Chennai

PostPosted: Fri May 02, 2008 11:12 am
Reply with quote

hi,

Quote:
ADDRESS ISPEXEC "LMINIT DATAID(dataid) DATASET('"YOUR DATSET"')"
ADDRESS ISPEXEC "LMOPEN DATAID("dataid") OPTION(INPUT)"
IF RC = 8 THEN SAY 'AUTHORIZATION REQUIRED'


This code is working. Thanks.

But still i have a doubt. If RC = 8, i am getting the error message, along with the message ''AUTHORIZATION REQUIRED'

ICH408I USER(U133598 ) GROUP(AJD25910) NAME(SOUMYA )
U168551.CICS.PGMS CL(DATASET ) VOL(LPRJ15)
INSUFFICIENT ACCESS AUTHORITY
FROM U168551.** (G)
ACCESS INTENT(READ ) ACCESS ALLOWED(NONE )
IEC150I 913-38,IFG0194E,U133598,IKJUSER,ISP10327,E427,LPRJ15,U168551.CICS.PGMS
AUTHORIZATION REQUIRED

I need only the error message that i gave in the program('AUTHORIZATION REQUIRED').
Is there any way, not to list the other error message.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue May 06, 2008 10:33 am
Reply with quote

Yes Soumya. I tried to suppress that display using outtrap, but it didn't work. Even you get the above message, the execution will continue without any problem. Hope this helps.
Back to top
View user's profile Send private message
soumyanamboo

New User


Joined: 16 Apr 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 06, 2008 10:36 am
Reply with quote

Thanks, Srihari.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Mon May 12, 2008 10:44 pm
Reply with quote

> "try to access it and see what you get for an error. Then code for that error. . "

I would amend that to say 'try to query your access and see what you get for a response.'

You can check access by using the RACF command, LISTDSD, to list your authority.

Here is a snippet of a program...

Code:

x = outtrap("lines.",30,"NOCONCAT")                                     
/*******************************************************************/   
/* CHECK FOR A DISCRETE PROFILE                                    */   
/*******************************************************************/   
Address TSO "LD DA("dsname")   ALL"                                     
ldrc = rc                                                               
If ldrc = 4 then                                                       
  Do                                                                   
    /*****************************************************************/
    /* EITHER NO PROFILE EXISTS OR NOT AUTHORIZED                    */
    /*****************************************************************/
    If substr(lines.1,1,8) ¬= "NOT AUTH" then                           
      Do                                                               
        /*************************************************************/
        /* NO DISCRETE EXISTED, CHECK GENERIC                        */
        /*************************************************************/
        Address TSO "LD DA("dsname") GEN"                               
        ldrc = rc                                                       
      End                                                               
  End                                                                   
x = outtrap(OFF)                                                       
/*******************************************************************/   
/* IF RETURN CODE WAS ZERO, YOU CAN LOOK AT THE DATASET.           */   
/*******************************************************************/   
If ldrc = 0 Then                                                       
  Do                                                                   
 


FYI. I do not think the output from commands is a programming interface, so it may change.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
Search our Forums:

Back to Top