TAA Tools
RTVIBMPRF       RETRIEVE IBM PROFILE                   TAASEFC

The Retrieve  IBM Profile command  retrieves a  list of system  profile
names to a  large variable.  By looping thru  the list, you can quickly
determine if a user profile name was shipped by the system.

If  you  only want  to check  a few  profiles,  the TAA  Tool CHKIBMPRF
should be  used.    CHKIBMPRF uses  the  same  technique shown  in  the
sample code.

The  intent   of  using   RTVIBMPRF  directly  is   to  allow   a  fast
determination  of whether  the profile  belongs to the  system or  is a
user created profile (invoking CHKIBMPRF  many times is not as fast  as
looping thru the list in a CL or HLL program).

RTVIBMPRF  returns a  list  in  a 3000  byte  variable  with each  name
taking 10 bytes.  A blank name will always exist at the end.

If you  want an array of these values in  an RPG program, use RTVIBMPRF
in CL  and pass  the return  parameter to  RPG.   The array  should  be
defined as 300 elements of 10 characters each.

The following  sample code is in  the proper format  to be copied  to a
CL source  member.  If you are  checking in a HLL program  (not CL), do
the RTVIBMPRF command in CL and pass the list to the HLL program.

Note  that the code  considers any profile name  that begins with other
than a Q to be a user type profile (whether it exists or not).

If a system profile is  shipped that is not known in the  list provided
by the tool,  the sample code checks to determine  if the 'create user'
is  *IBM, QLPINSTALL, or  QLPAUTO.  If  the profile was  created by one
of these names,  the profile  is also  considered to be  a system  type
(this same check occurs in CHKIBMPRF).

             DCL        &USRPRF *CHAR LEN(10)
             DCL        &PRFLST *CHAR LEN(3000)
             DCL        &PX *DEC LEN(5 0)
             DCL        &WRK *CHAR LEN(10)
             DCL        &CRTUSR *CHAR LEN(10)

             RTVIBMPRF  PRFLST(&PRFLST)

                        /* Access &USRPRF to be checked */
             IF         (%SST(&USRPRF 1 1) *EQ 'Q') DO /* Q name */
             CHGVAR     &PX -9
 LOOP:       CHGVAR     &PX (&PX + 10)
             CHGVAR     &WRK %SST(&PRFLST &PX 10)
             IF         (&WRK *NE ' ') DO /* Some profile */
             IF         (&WRK *EQ &USRPRF) DO /* Specific sys name */
             GOTO       SYSTYPE
             ENDDO      /* Specific sys name */
             GOTO       LOOP
             ENDDO      /* Some profile */
                        /* Not found, try RTVOBJD create user */
             CHKOBJ     OBJ(&USRPRF) OBJTYPE(*USRPRF)
             MONMSG     MSGID(CPF9801) EXEC(DO) /* Does not exist */
                        /********************************************/
                        /*                                          */
                        /*       Your code for does not exist       */
                        /*                                          */
                        /********************************************/
             ENDDO      /* Does not exist */
                        /* Not found, try RTVOBJD create user */
             RTVOBJD    OBJ(&USRPRF) OBJTYPE(*USRPRF) CRTUSER(&CRTUSR)
             IF         ((&CRTUSR *EQ '*IBM') *OR +
                          (&CRTUSR *EQ 'QLPINSTALL') *OR +
                          (&CRTUSR *EQ 'QLPAUTO')) DO /* Sys crt */
             GOTO       SYSTYPE
             ENDDO      /* Sys create user */
             ENDDO      /* Q name  */
                        /********************************************/
                        /*                                          */
 USRTYP:                /*       User type profile                  */
                        /*                                          */
                        /********************************************/
             DO         /* User type profile */
                        /*                                          */
                        /*      Your processing of user type        */
                        /*                                          */
             ENDDO      /* User type profile */

                        /********************************************/
                        /*                                          */
 SYSTYPE:               /*       System type profile                */
                        /*                                          */
                        /********************************************/
             DO         /* System type profile */
                        /*                                          */
                        /*      Your processing of Sys type         */
                        /*                                          */
             ENDDO      /* System type profile */

RTVIBMPRF escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

Command parameters                                    *CMD
------------------

   PRFLST        The  return  variable containing  the  system  profile
                 names.    Each name  is  10 bytes  and  a  blank value
                 always  exists  after  the  last  name.    The  return
                 variable must be specified as *CHAR LEN(3000).

                 If  you  are   going  to  process  the  list,   it  is
                 recommended  that you provide  the same check  for the
                 'create  user'  as shown  in  the sample  code  of the
                 tool documentation.

                 If  you want  an  array  of  these values  in  an  RPG
                 program,  use  RTVIBMPRF in  CL  and  pass the  return
                 parameter  to RPG.    The array  should be  defined as
                 300 elements of 10 characters each.

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

None.

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

None.

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

None, the tool is ready to use.

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

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

   RTVIBMPRF     *CMD                   TAASEFC       QATTCMD
   TAASEFCC      *PGM       CLP         TAASEFCC      QATTCL
					

Added to TAA Productivity tools August 15, 2001


Home Page Up to Top