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

Check for authorization to access a PDS


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

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 1:33 pm
Reply with quote

Hi all,

I am using a CLIST to write into a PDS. But before writing any records to the PDS, the program should check if the user has the authorization to acces the PDS. i.e to check for access to some High Level Qualifiers.

Is there any command that can help me out here?

A similar CLIST is shown below.

Code:


PROC 0                                                           
ALLOCATE FILE(RTSTR) DA('NUP.RT.SRCH.Q') MOD REU   
OPENFILE RTSTR OUTPUT                                           
SET RTSTR = &SYSNSUB(1,ABCDEFG)                                   
PUTFILE RTSTR                                                   
CLOSFILE RTSTR                                                 
EXIT CODE(0)                                                     



The o/p im getting currently is:
Code:

OPENFILE RTSTR OUTPUT             
INTERNAL COMMAND PROCEDURE ERROR+   
EXEC ERROR CODE S913               


Could you please help me here?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 27, 2009 1:49 pm
Reply with quote

see ibmmainframes.com/viewtopic.php?t=30182&highlight=authorization+checking
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 3:52 pm
Reply with quote

enrico-sorichetti wrote:
see ibmmainframes.com/viewtopic.php?t=30182&highlight=authorization+checking


Do the same commands(mentioned in the thread provided) work for CLIST as well? I guess not.
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 3:52 pm
Reply with quote

enrico-sorichetti wrote:
see ibmmainframes.com/viewtopic.php?t=30182&highlight=authorization+checking


Do the same commands(mentioned in the thread provided) work for CLIST as well? I guess they dont.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 27, 2009 4:14 pm
Reply with quote

I guess you ought to try icon_rolleyes.gif
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 4:17 pm
Reply with quote

expat wrote:
I guess you ought to try icon_rolleyes.gif


I just did.
It then tells to include /* REX */ as the first command.
Without /* REX */ it does not recognize the commands.....
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 27, 2009 4:44 pm
Reply with quote

the link was not about the code, but about the logic,
if You are not authorized You will get an error,

the best thing would be to run three tests
1) dataset exists
2) datasets does not exist
3) dataset exist but You are not authorized to it

watch the return code decode it and act accordingly!
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 5:30 pm
Reply with quote

enrico-sorichetti wrote:
the link was not about the code, but about the logic,
if You are not authorized You will get an error,

the best thing would be to run three tests
1) dataset exists
2) datasets does not exist
3) dataset exist but You are not authorized to it

watch the return code decode it and act accordingly!


I have tried couple of commands in CLIST including LISTDSI, SYSDSN...
These do tell about the dataset availability...but cannot tell if i have authority to access a PDS or not.

There is a High Level Qualifier for which i can access the PDS characteristics but donot have read or write access. Im getting RC0 for above listed commands, hence unable to handle the error...

I am very new to CLIST and have not coded in REXX too...can u please tell if there is a way to execute REXX commands in CLIST?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 27, 2009 5:39 pm
Reply with quote

The commands are TSO commands and therefor common to both REXX and CLIST.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 27, 2009 5:59 pm
Reply with quote

Quote:
But before writing any records to the PDS, the program should check if the user has the authorization to acces the PDS. i.e to check for access to some High Level Qualifiers.
You'll need to invoke the API for the security package used on site -- RACF, TOP SECRET, ACF2 -- and pass it the appropriate data to get back the access authorization. You'll probably want to get with your site security team to determine the best way to achieve your goal.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 27, 2009 6:00 pm
Reply with quote

Quote:
I am very new to CLIST


since You are new You better start with rexx,
more possibilities, more interfaces, more samples, more skills
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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
Search our Forums:

Back to Top