Share 2011 02 Irrxutil
Share 2011 02 Irrxutil
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corporation in the United States, other countries, or both. If these and
other IBM trademarked terms are marked on their first occurrence in this information with
a trademark symbol (® or ™), these symbols indicate U.S. registered or common law
trademarks owned by IBM at the time this information was published. Such trademarks
may also be registered or common law trademarks in other countries. A current list of IBM
trademarks is available on the Web at "Copyright and trademark information" at
www.ibm.com/legal/copytrade.shtml
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other company, product, or service names may be trademarks or service marks of others.
What is R_admin?
–Functions
–Authorizations
What is IRRXUTIL?
–Relationship to R_admin
–Invocation syntax
–Sample invocation
–Considerations
–Return Codes
–Returned data
–Getting the “next” profile
–Finding field names
–References
… and more!
myrc=IRRXUTIL(function,type,profile,stem,prefix,generic)
–Function: “EXTRACT” or “EXTRACTN”
–Type: “USER”, “GROUP”, “CONNECT”, “_SETROPTS”, general
resource class. DATASET not supported.
–Profile: Profile to extract. Case sensitive. Specify '_SETROPTS'
for SETROPTS data.
–Stem: REXX stem variable name to populate with results. Do not
put the '.' at the end.
–Prefix: Optional prefix for returned variable name parts (more
later)
–Generic: Optional, 'TRUE' or 'FALSE' (uppercase). Applies to
general resource profiles only.
The caller needs access to use R_admin extract via the appropriate
FACILITY class profile protecting the desired function.
In addition, the caller must be allowed to retrieve the profile in
question. The caller will only have fields they are allowed to view
returned.
This is all enforced by the R_admin extract function which
IRRXUTIL calls.
Success 0 0 0 0 0
Warning, stem contained '.' 2 0 0 0 0
Bad number of parameters specified 4 Number of Min number Max 0
parms specified allowed number
allowed
0 0 0 0 0 = Success
8 x y 0 0 = Error in IRRXUTIL invocation
–“x” – Number of the incorrect parameter
–“y” – What’s wrong
• 1: Bad length
• 2: Bad value
• 3: Inconsistent with other parameters
12 12 4 4 4 = Profile not found
12 12 8 8 24 = Not authorized to R_admin extract
Check the first value in the return code string. If it is 0, the call was
successful.
/* REXX */
myrc=IRRXUTIL("EXTRACT","FACILITY","BPX.DAEMON","RACF","","F
ALSE")
If (word(myrc,1)>0) then do
say "Error calling IRRXUTIL "||myrc
exit
end
say "Profile name: "||RACF.profile
do a=1 to RACF.BASE.ACLCNT.REPEATCOUNT
Say " "||RACF.BASE.ACLID.a||":"||RACF.BASE.ACLACS.a
end
stem.BASE.CONNECTS
stem.BASE .REPEATCOUNT = 3
.SUBFIELD.0 = 15
.0 = 30 .SUBFIELD.1 = “CGROUP”
.1 = “NAME” .SUBFIELD.2 = “CAUTHDA”
.2 = “SPECIAL” .SUBFIELD.3 = “COWNER”
.3 = “CLCNT” .SUBFIELD.n = … … …
.4 = “CLAUTH”
.5 = “CONNECTS” stem.BASE.CGROUP stem.BASE.CAUTHDA stem.BASE.COWNER
.6 = “CGROUP” .0 = 3 .0 = 3 .0 = 3
.7 = “CAUTHDA” .1 = “SYS1” .1 = “07/06/87” .1 = “IBMUSER”
.8 = “COWNER” .2 = “RACFDEV” .2 = “03/12/91” .2 = “ADMIN1”
.9 = “CLJTIME” .3 = “IBMPOK” .3 = “08/21/94” .3 = “ADMIN2”
.10= “CLJDATE”
.n = … … … stem.BASE.CLJTIME stem.BASE.CLJDATE stem.BASE.Cxxxxx
… … … … … … … … …
/* REXX */
RACF.profile='IBMUSER'
myrc=IRRXUTIL("EXTRACT","USER",RACF.profile,"RACF")
If (Word(myrc,1) <> 0) Then Do
Say myrc
exit
end
/* REXX */
class = 'FACILITY'
RACF.R_PROFILE = ' '
RACF.R_GENERIC= 'FALSE'
Do Forever
myrc=IRRXUTIL("EXTRACTN",class,RACF.R_PROFILE,"RACF","R_",RACF.R_GENERIC)
If (Word(myrc,1) <> 0) Then Do
Say myrc
Leave
End
Say RACF.R_PROFILE /* print profile name */
End
EX ‘SAMPLE(IRREXXSR)’
Extract users with no ‘.’ in stem.
MEGA UID is 8
ELVIS UID is
Extract users with '.' in stem to demonstrate error
MEGA UID is 8
ELVIS UID is
READY
Extract?
Segment
Field
29 © 2011 IBM Corporation
Gotchas
IRRXUTIL sets the entire stem to "" (null) before setting new
data. Fields which do not exist in the extracted profile remain
null.
–This can cause problem in fields which are usually returned as numeric
fields because they also remain "", and not 0. So, care must be taken
before referencing numeric fields as numbers.
/* REXX */
arg group
myrc=IRRXUTIL("EXTRACT","GROUP",group,"RACF","")
do i=1 to RACF.BASE.SUBGROUP.0
say "Subgroup: "RACF.BASE.SUBGROUP.i
end
The above program fails if the specified group has no SUBGROUPs
because RACF.BASE.SUBGROUP.0="" which is not a number.
Universal Groups.
–Remember that a universal group profile does not contain a list of the
users who are connected to the group with USE authority.
Discrete profiles which contain generic characters will cause the
underlying R_admin service to fail if they are encountered during an
EXTRACTN call.
–IRRXUTIL fails also
–The only solution is to RDELETE these erroneous profiles.
–There are few cases where discrete profiles are expected to contain
generic characters and R_admin handles these properly.
Do not beat on the RACF database. For example, do not EXTRACT-
NEXT all users in an attempt to find all users which belong to a given
Universal Group.
31 © 2011 IBM Corporation
References