Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

GETUGR Identify group membership of user ID

The GETUGR macro supplies the name (group ID) of the user group of which a specified user ID is a member. The relevant group is identified with the aid of the group structure existing on the home pubset of the current session. If the specified user ID is a member of the default user group *UNIVERSAL, the group ID is undefined; this is indicated by the value of the return code.

Domain: system administration

Macro type: type S (standard form / E form / L form / C form / D form

Macro

Operanden

GETUGR

MF=C / D / L / E

,PREFIX = p / S

,PARAM = (r) / addr

For a description of the parameters MF, PREFIX, MACID, PARAM see the “Executive Macros” manual [16].

Before the GETUGR macro is called, the user ID whose group name is to be determined must be entered in the SRMUUID field.

If a user group administrator or global user administrator wants to ascertain the group corresponding to a user ID which is not entered in the home pubset, then he or she must also specify the catalog ID of this pubset in the SRMUPVS field. If a user who possesses none of these administrative privileges explicitly specifies the pubset then the call is rejected with a parameter error.

Output operands:

The group ID is entered in the SRMGGID field of the parameter list. If the user ID is a member of the default user group *UNIVERSAL, the contents of this field are undefined; this is indicated by the value of the return code.

Parameter list (GETUGR MF=D)

SRMUGT   DSECT , 
               *,##### PREFIX=S, MACID=RMU ##### 
* 
SRMUFHDR FHDR  MF=(C,SRMU),EQUATES=NO                   standard header 
SRMUFHDR DS    0A 
SRMUFHE  DS    0XL8            0   GENERAL PARAMETER AREA HEADER 
* 
SRMUIFID DS    0A              0   INTERFACE IDENTIFIER 
SRMUFCTU DS    AL2             0   FUNCTION UNIT NUMBER 
*                                  BIT 15    HEADER FLAG BIT, 
*                                  MUST BE RESET UNTIL FURTHER NOTICE 
*                                  BIT 14-12 UNUSED, MUST BE RESET 
*                                  BIT 11-0  REAL FUNCTION UNIT NUMBER 
SRMUFCT  DS    AL1             2   FUNCTION NUMBER 
SRMUFCTV DS    AL1             3   FUNCTION INTERFACE VERSION NUMBER 
* 
SRMURET  DS    0A              4   GENERAL RETURN CODE 
SRMUSRET DS    0AL2            4   SUB RETURN CODE 
SRMUSR2  DS    AL1             4   SUB RETURN CODE 2 
SRMUSR1  DS    AL1             5   SUB RETURN CODE 1 
SRMUMRET DS    0AL2            6   MAIN RETURN CODE 
SRMUMR2  DS    AL1             6   MAIN RETURN CODE 2 
SRMUMR1  DS    AL1             7   MAIN RETURN CODE 1 
SRMUFHL  EQU   8               8   GENERAL OPERAND LIST HEADER LENGTH 
* 
*   main return codes 
SRMUOK   EQU   0                         group id of user valid 
SRMUUNI  EQU   1                         user is in group *UNIVERSAL 
SRMUUND  EQU   2                         user not defined on pubset 
SRMUPER  EQU   3                         parameter error 
SRMUPNA  EQU   5                         pubset not available 
SRMUSER  EQU   255                       system error 
* 
SRMUUID  DS    CL8                       user id for which information 
*                                        is sought 
SRMUPVS  DS    CL4                       pubset on which user is 
*                                        defined 
SRMUGID  DS    CL8                       group id for user on pubset 
SRMU#    EQU   *-SRMUFHDR 
Note

The GETUGR macro changes the contents of registers R1, R14 and R15.

Return codes

The following return codes may occur in addition to the standard return codes:

SC1

Maincode

Meaning

ESMRFSP

SRMUOK

The group ID has been identified and stored in parameter field
SRMGGID.

ESMRFSP

SRMUUNI

The user ID is a member of the default group *UNIVERSAL.

ESMRFSP

SRMUUND

The user ID does not exist on the pubset.

ESMRCAR

SRMUPER

Parameter error.

ESMRCAR

SRMUPNA

The pubset is not accessible.

ESMRIER

SRMUSER

System error.

Example

Determining the group name for the user ID ’SRPMUSER’ and checking whether an error has occurred.

GETUGR   START 
*--------------------------------------------------------------------* 
* PROGRAM: MANUAL EXAMPLE FOR GETUGR  SRPM TESTS                     * 
*--------------------------------------------------------------------* 
GETUGR   RMODE ANY 
GETUGR   AMODE ANY 
         GPARMOD 31 
         BALR  3,0 
         USING *,3 
*--------------------------------------------------------------------* 
*    DETERMINE THE USER GROUP FOR USER ID 'SRPMUSER'                 * 
*--------------------------------------------------------------------* 
         MVC   SRMUUID,='SRPMUSER' 
         GETUGR MF=E,PARAM=GICHKL 
         CLI   SRMUMR1,SRMUOK 
         BNE   FEHLER 
*                           PROCESS THE USER-GROUP ID 
         B     ENDE 
FEHLER   EQU   * 
*                           ERROR HANDLING 
ENDE     TERM 
**-------------------------------------------------------------------* 
GICHKC   GETUGR MF=C 
         ORG   GICHKC 
GICHKL   GETUGR MF=L 
         END