TAA Tools
RTVLSTOBJ       RETRIEVE LAST OBJECT                   TAAMBRI

The Retrieve Last  Object command retrieves  the last object name  of a
generic group  of objects.   The default is  for all object  types.  If
the  same name exists for different  object types, the last object type
(per system  order) determines  the object that  is returned.   If  you
are naming objects  using a generic technique, RTVLSTOBJ  can assist in
determining the last name assigned.

A typical series of commands would be:

             DCL        &LSTOBJ TYPE(*CHAR) LEN(10)
              .
             RTVLSTOBJ  OBJ(ABC*) LSTOBJ(&LSTOBJ)

The  last object name  that began with  ABC would be returned.   If the
last name was ABC999  and both a *FILE and  *PGM object use that  name,
the *FILE object  would be returned.   This is based on  the order used
by the  system as can be seen using DSPLIB  on a library with different
object types.  If  an ABC object existed  in multiple libraries on  the
library  list, the  ABC  object  found in  the  last library  would  be
returned.

The OBJ name could be entered without an '*' such as:

             RTVLSTOBJ OBJ(ABC) LSTOBJ(&LSTOBJ)

If the  name is less  than 10 bytes, an  * would be added  and the same
result would be achieved.

Depending  on the selection criteria, RTVLSTOBJ  could take a long time
to run.

RTVLSTOBJ escape messages you can monitor for
---------------------------------------------

      TAA9893    No objects exist

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

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

   OBJ           The  qualified name  of  the  object to  retrieve  the
                 last  name for.    A generic  name  would normally  be
                 entered  such  as  ABC*.    The  name  ABC  without  a
                 trailing * may also be  entered and would achieve  the
                 same results.

                 If  the last  name was  ABC999  and both  a *FILE  and
                 *PGM object  type use that name, the  last type of the
                 same name  would  be  returned (ie  the  *FILE  object
                 would be  returned because  of the  order used by  the
                 system).

                 The  library  value defaults  to  *LIBL.   A  specific
                 library or *CURLIB may also be used.

   OBJTYPE       The  object type  to retrieve  the last  name for.   A
                 specific type  must be named.   *ALL  is the  default.
                 Use the  command prompter for the full  list of types.

   LSTOBJ        The  last object name  of the generic names.   This is
                 an optional  return  variable  that if  used  must  be
                 specified as *CHAR LEN(10).

   LSTLIB        The library of  the last object.  This  is an optional
                 return  variable  that if  used must  be  specified as
                 *CHAR LEN(10).

   LSTOBJTYPE    The object  type  of the  last  object.   This  is  an
                 optional  return  variable   that  if  used   must  be
                 specified as *CHAR LEN(7).

   TOTGEN        The total  number of generic  objects found.   This is
                 an  optional  return  variable that  if  used  must be
                 specified as *DEC LEN(7 0).


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

Because the RTVLSTOBJ command  returns variables, the command  may only
be used in a CL program.

A maximum of about 160,000 generic names may exist.

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

The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     RSNLSTMSG       Resend last message
     RTVOBJLST       Retrieve object list
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   RTVLSTOBJ     *CMD                   TAAOBMA       QATTCMD
   TAAOBMAC      *PGM       CLP         TAAOBMAC      QATTCL
					

Added to TAA Productivity tools July 15, 2010


Home Page Up to Top