TAA Tools
USRGRP          USER GROUP                             TAASEDM

The User Group  tool is a series  of commands that allow you  to define
and  maintain a group  of users.   The  support has no  connection with
the system Group Profile support.

The intent of the User Group tool is to allow you to group users for:

  **   The sending of messages.  See the SNDUSGMSG tool.

  **   Granting authority.  See the GRTUSGAUT tool.

  **   Your own application needs.

You begin by creating the objects needed for the User Group tool:

            CRTUSGOBJ   USGLIB(xxx)

This creates the following USRGRPx files in the named library:

       USRGRPP     PF    One record per user group
       USRGRPS     PF    One record per user of a group
       USRGRPL     LF    Keyed file over USRGRPA
       USRGRPT     LF    Keyed file over USRGRPS

You  can have as  many sets of files  as needed, but  only a single set
per  library.   The  files  are  created  so that  the  user  who  runs
CRTUSGOBJ becomes the  owner of the files and is the  only user who can
change  the data (the  owner may  authorize other users).   The *PUBLIC
user has access to use any of the data in the files.

You maintain  the  files with  the Edit  command.   A  typical  command
would be:

             EDTUSG

A subfile is displayed  with one line per user  group with the standard
options  for change, display, delete,  add, copy, and  rename.  Another
option lets you  work with  the users  that make  up the  group.   This
displays  another  subfile  with  one  record  per  user  and  standard
options for change, display, delete, and add.

Both the  user group record and the user  record have additional fields
that  you may  enter for  your own application  needs such  as the text
description  of a  user  group  or an  attribute  of  the group  or  an
attribute of the user.

The same user can  be in multiple groups.  It is not  an error to enter
a user who does not exist on the system.

If  you are  authorized to  the TAARTVUSR2 authorization  list provided
by the RTVUSRPRF2 TAA Tool,  the text description of any existing  user
profile will appear in  the subfile display.  This data is  not part of
the  data  base files,  but is  extracted  from the  user  profile when
required.

A basic print function exists  to print one or all  of the groups or  a
specific user  (all  groups the  user exists  in).   A typical  command
would be:

             PRTUSG

For your  own functions that  want to access  the groups or  members of
the groups, two RTV commands are provided:

  **   RTVUSG  provides  return variables  for  a group  containing the
       group information.   Up to  999 users are  placed in the  return
       variable &USRLST2 and  allows you to substring the  names out of
       the  list  (the USRLST  parameter  contains the  same  list, but
       only up to 300 users).

TAA9891 is sent  as an escape message  if the user  group is not  found
in the file.

       The following  would be typical code  that is in a  format ready
       to be copied:

             DCL        &USRCNT *DEC LEN(3 0)
             DCL        &USRLST2 *CHAR LEN(9990)
             DCL        &USER *CHAR LEN(10)
             DCL        &UX *DEC LEN(5 0)
             DCL        &UCNT *DEC LEN(3 0)
              .
             RTVUSG     USG(xxx) USRCNT(&USRCNT) +
                          USRLST2(&USRLST2)
             CHGVAR     &UX -9
 LOOP:       CHGVAR     &UCNT (&UCNT + 1)
             IF         (&UCNT *LE &USRCNT) DO /* Get user */
             CHGVAR     &UX (&UX + 10)
             CHGVAR     &USER %SST(&USRLST2 &UX 10)
                        /***********************************/
                        /*                                 */
                        /*    Your processing of &USER     */
                        /*                                 */
                        /***********************************/
             GOTO       LOOP
             ENDDO      /* Get user */

  **   RTVUSGUSR  allows   the  additional  application  fields  to  be
       returned for a specific user of a group.

       TAA9891 is sent as  an escape message if  the user group is  not
       found in  the file.   TAA9892 is  sent as  an escape  message if
       the  user group is  found, but  the user  does not exist  in the
       group.

       Typical coding would be:

             DCL        &FIELD1 *CHAR LEN(10)
              .
             RTVUSGUSR USGP(xxx) USER(yyy) FLD1(&FIELD1)

The EDTUSG command must be used to establish a user group.

You  can  add  members to  the  group using  the  interactive interface
provided by EDTUSG or the separate command ADDUSGUSR.

You can remove members  from the group using the  interactive interface
provided by EDTUSG or the separate command RMVUSGUSR.

CRTUSGOBJ command parameters                          *CMD
----------------------------

   USGLIB        The library  where the USRGRPx files  will be created.

   SRCLIB        The  source library  of  the DDS  source.   *TAAARC is
                 the  default  to  access  the  source  from   the  TAA
                 Archive.  A  specific library may also be  used if you
                 have  first  copied the  source  from  the Archive  to
                 your library.  QATTDDS must  be the source file  name.

DLTUSGOBJ command parameters                          *CMD
----------------------------

   USGOBJ        The library where the USRGRPx files exist.

EDTUSG command parameters                             *CMD
-------------------------

   USG           The user  group to -position  to- when the  subfile is
                 displayed.   You may also use the  -position to- field
                 at  the  top  of  the  display  once  the  subfile  is
                 displayed.

                 If blank,  the first user  group in  the file  appears
                 at the beginning of the subfile.

   USGLIB        The library  where the USRGRPx files exist.   *LIBL is
                 the default.  *CURLIB may be specified.

RTVUSG command parameters                             *CMD
-------------------------

   USG           The user group to be retrieved.

   USGLIB        The  library where the USRGRPx files  exist.  *LIBL is
                 the default.  *CURLIB may be specified.

   RTNLIB        An optional  return  variable that  will  contain  the
                 name  of  the  library  where the  USRGRPx  files  are
                 found.   This parameter  can be helpful  when *LIBL or
                 *CURLIB is  specified for  USGLIB.   If specified,  it
                 must be declared as *DEC LEN(3 0).

   USRCNT        An  optional return  variable  that will  contain  the
                 count  of  the  number of  users  in  the  group.   If
                 specified, it must be declared as *DEC LEN(3 0).

   USRLST        An  optional return  variable that will  contain up to
                 300 users  of the  group.   The first  user begins  in
                 position 1  with each user  name taking 10 bytes.   If
                 specified, it must be declared as *CHAR LEN(3000).

                 See  the previous example  of how to  access the data.

   USRLST2       An optional return  variable that  will contain up  to
                 999 users  of the  group.   The first  user begins  in
                 position  1 with each user  name taking 10  bytes.  If
                 specified, it must be declared as *CHAR LEN(9990).

                 See the previous  example of how  to access the  data.

   TEXT          An  optional return  variable  that will  contain  the
                 text description  of the user group.   For any data to
                 be  retrieved,  an  entry must  have  been  made using
                 EDTUSG.  If  specified, it must  be declared as  *CHAR
                 LEN(50).

   FLD1          An  optional return  variable  that  will contain  the
                 value  of Field 1 of the user  group.  For any data to
                 be retrieved,  an  entry  must have  been  made  using
                 EDTUSG.   If specified, it  must be declared  as *CHAR
                 LEN(10).

   FLD2          An  optional  return variable  that  will  contain the
                 value of Field 2 of the  user group.  For any data  to
                 be  retrieved, an  entry  must  have been  made  using
                 EDTUSG.   If specified, it  must be declared  as *CHAR
                 LEN(10).

   FLD3          An  optional  return  variable that  will  contain the
                 value of Field 3 of  the user group.  For any  data to
                 be  retrieved,  an entry  must  have  been made  using
                 EDTUSG.   If specified,  it must be  declared as *CHAR
                 LEN(10).

RTVUSGUSR command parameters                          *CMD
----------------------------

   USG           The user group to be retrieved.

   USER          The user record to retrieve information from.

   USGLIB        The library where the USRGRPx  files exist.  *LIBL  is
                 the default.  *CURLIB may be specified.

   RTNLIB        An  optional return  variable  that  will contain  the
                 name  of  the  library  where  the  USRGRPx files  are
                 found.  This  parameter can be  helpful when *LIBL  or
                 *CURLIB is specified for USGLIB.

   FLD1          An  optional return  variable  that will  contain  the
                 value  of Field 1  of the user  record.  For  any data
                 to  be retrieved, an  entry must have  been made using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(10).

   FLD2          An  optional return  variable  that  will contain  the
                 value  of Field 2  of the  user record.   For any data
                 to be retrieved,  an entry must  have been made  using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(10).

   FLD3          An  optional  return variable  that  will  contain the
                 value of Field  3 of the  user record.   For any  data
                 to be  retrieved, an entry  must have been  made using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(10).

   FLD4          An  optional  return  variable that  will  contain the
                 value of  Field 4 of  the user record.   For any  data
                 to be  retrieved, an entry  must have been  made using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(50).

   FLD5          An optional  return  variable that  will  contain  the
                 value of  Field 5 of  the user record.   For  any data
                 to  be retrieved, an  entry must have  been made using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(50).

   FLD6          An  optional return  variable  that will  contain  the
                 value  of Field 6  of the user  record.  For  any data
                 to  be retrieved, an  entry must have  been made using
                 EDTUSG  or  ADDUSGUSR.    If  specified,  it  must  be
                 declared as *CHAR LEN(50).

ADDUSGUSR command parameters                          *CMD
----------------------------

   USG           The  user  group that  will  contain  the  user to  be
                 added.   The user  group must have  been created using
                 EDTUSG.

   USER          The user to be added to the group.

   USGLIB        The library where the USRGRPx  files exist.  *LIBL  is
                 the default.  *CURLIB may be specified.

   CHKEXIST      Whether  to  check  for  the  existence  of  the  user
                 profile.   *YES  is the default  which means  the user
                 profile must  exist.   TAA9895  is  sent if  the  user
                 profile does not exist.

                 *NO  means there  is  no check  for  whether the  user
                 profile exists.

   FLD1          An  optional field  of 10  bytes that  may be  used to
                 contain  any other information  your application needs
                 about the user.

   FLD2          An optional  field of  10 bytes  that may  be used  to
                 contain any  other information your  application needs
                 about the user.

   FLD3          An  optional field  of 10  bytes that  may be  used to
                 contain any other  information your application  needs
                 about the user.

   FLD4          An optional  field of  50 bytes  that may  be used  to
                 contain  any other information  your application needs
                 about the user.

   FLD5          An optional  field of  50 bytes  that may  be used  to
                 contain any  other information your  application needs
                 about the user.

   FLD6          An  optional field  of 50  bytes that  may be  used to
                 contain  any other information  your application needs
                 about the user.

RMVUSGUSR command parameters                          *CMD
----------------------------

   USG           The user group that  contains the user to be  removed.

   USER          The user to be removed from the group.

   USGLIB        The library  where the USRGRPx files exist.   *LIBL is
                 the default.  *CURLIB may be specified.

PRTUSG command parameters                            *CMD
-------------------------

   USG           The  user group  to be printed.   *ALL  is the default
                 to print all  of the  user groups found  in the  files
                 for the specified library.

   USER          The  user to  be  printed.   *ALL  is  the default  to
                 print all of the users.

                 If  a specific user  is named, USG(*ALL)  must be used
                 and the spooled  file will contain  all of the  groups
                 the user exists in.

   USGLIB        The library where  the USRGRPx files exist.   *LIBL is
                 the default.  *CURLIB may be specified.

Restrictions
------------

The user  of the EDTUSG and  PRTUSG commands must be  authorized to the
TAARTVUSR2 authorization list for the user profile text to appear.

Prerequisites
-------------

The following TAA Tools must be on your system:

     CHKOBJ2         Check object description 2
     CPYTAADDS       Copy TAA DDS
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     LOCKMSG         Lock message
     RPGSTSDS        RPG Status data structure
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     RTVUSRPRF2      Retrieve user profile 2
     WRTSRC          Write source

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   EDTUSG        *CMD                   TAASEDM       QATTCMD
   CRTUSGOBJ     *CMD                   TAASEDM2      QATTCMD
   RTVUSG        *CMD                   TAASEDM3      QATTCMD
   RTVUSGUSR     *CMD                   TAASEDM4      QATTCMD
   ADDUSGUSR     *CMD                   TAASEDM5      QATTCMD
   RMVUSGUSR     *CMD                   TAASEDM6      QATTCMD
   PRTUSG        *CMD                   TAASEDM7      QATTCMD
   DLTUSGOBJ     *CMD                   TAASEDM8      QATTCMD
   TAASEDMC      *PGM       CLP         TAASEDMC      QATTCL
   TAASEDMC2     *PGM       CLP         TAASEDMC2     QATTCL
   TAASEDMC3     *PGM       CLP         TAASEDMC3     QATTCL
   TAASEDMC4     *PGM       CLP         TAASEDMC4     QATTCL
   TAASEDMC5     *PGM       CLP         TAASEDMC5     QATTCL
   TAASEDMC6     *PGM       CLP         TAASEDMC6     QATTCL
   TAASEDMC7     *PGM       CLP         TAASEDMC7     QATTCL
   TAASEDMC8     *PGM       CLP         TAASEDMC8     QATTCL
   TAASEDMC12    *PGM       CLP         TAASEDMC12    QATTCL
   TAASEDMR      *PGM       RPG         TAASEDMR      QATTRPG
   TAASEDMR3     *PGM       RPG         TAASEDMR3     QATTRPG
   TAASEDMR4     *PGM       RPG         TAASEDMR4     QATTRPG
   TAASEDMR5     *PGM       RPG         TAASEDMR5     QATTRPG
   TAASEDMR6     *PGM       RPG         TAASEDMR6     QATTRPG
   TAASEDMR7     *PGM       RPG         TAASEDMR7     QATTRPG
   TAASEDMR10    *PGM       RPG         TAASEDMR10    QATTRPG
   TAASEDMR12    *PGM       RPG         TAASEDMR12    QATTRPG
   TAASEDMD      *FILE      DSPF        TAASEDMD      QATTDDS
   TAASEDME      *FILE      DSPF        TAASEDME      QATTDDS
   TAASEDMA      *FILE      PF          TAASEDMA      QATTDDS
   TAASEDML      *FILE      LF          TAASEDML      QATTDDS
   TAASEDMS      *FILE      PF          TAASEDMS      QATTDDS
   TAASEDMT      *FILE      LF          TAASEDMT      QATTDDS

      Source used to create user files

         Source      User File
         ------      ---------

         TAASEDMA    USRGRPP
         TAASEDML    USRGRPL
         TAASEDMS    USRGRPS
         TAASEDMT    USRGRPT

Structure
---------

CRTUSGOBJ   Cmd
   TAASEDMC2  CL pgm

DLTUSGOBJ   Cmd
   TAASEDMC8  CL pgm

EDTUSG      Cmd
   TAASEDMC    CL pgm
     TAASEDMR    RPG Pgm - User group records
       TAASEDMD    Display file - User group records
       TAASEDMR10  RPG Pgm - User records
         TAASEDME    Display file - User records
         TAASEDMC12  CL pgm - Get user profile name
       TAASEDMR12  RPG Pgm - Copy, rename, remove user group

RTVUSG      Cmd
   TAASEDMC3   CL pgm
     TAASEDMR3   RPG Pgm

RTVUSGUSR   Cmd
   TAASEDMC4   CL pgm
     TAASEDMR4   RPG Pgm

ADDUSGUSR   Cmd
   TAASEDMC5   CL pgm
     TAASEDMR5   RPG Pgm

RMVUSGUSR   Cmd
   TAASEDMC6   CL pgm
     TAASEDMR6   RPG Pgm

PRTUSG      Cmd
   TAASEDMC7   CL pgm
     TAASEDMR7   RPG Pgm
       TAASEDMC12  CL Pgm  Get user profile name
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top