TAA Tools
EXTCMD      EXTRACT COMMAND NAME FROM A STRING         TAACMDG

The Extract Command command  allows you to extract a  command name from
a  string.    The command  name  and  library  are  returned as  return
values.

The  command  is intended  for those  environments  where the  user has
entered a command string  into a variable and  you want to extract  the
command  to  perform  your  own  check  or  special  processing  before
allowing the command to be run.

A typical use of the command would be:

            EXTCMD     FULLCMD(&CMDVAR) CMDNAM(&CMD) CMDLIB(&LIB)

If  the command string can be properly  parsed, the command and library
are passed back.   If no library exists,  the CMDLIB return value  will
be blank.

If errors are found, CPF9898 will be sent as an escape message.

Invalid  characters  within  the  library   or  command  name  are  not
diagnosed.

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

   FULLCMD       The  command string to  be checked.   It can be  up to
                 2000 bytes in length.   A '?' can precede the  command
                 (used  for  command  prompting).   If  a  preceding  ?
                 exists,   it  will  not   be  in  the   CMDNAM  return
                 variable.

   CMDNAM        The  return variable containing the  command name.  It
                 must be defined as *CHAR LEN(10).

   CMDLIB        An optional  return  variable containing  the  library
                 name.   It must  be defined as  *CHAR LEN(10).   If no
                 library exists, the return variable will be blank.

   RTNCMD        An  optional return  variable  which will  contain the
                 remainder  of   the  command   (without  any   leading
                 comments, labels,  command, or  command library).   If
                 specified, it must be declared as *CHAR LEN(2000).

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

The following TAA Tools must be on your system:

       SNDESCMSG     Send escape message

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

None, the tool is ready to use.

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

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

   EXTCMD        *CMD                      TAACMDG        QATTCMD
   TAACMDGC      *PGM          CLP         TAACMDGC       QATTCL
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top