TAA Tools
EXTVAL          EXTRACT VALUE                          TAACLRB

The  Extract  Value  command  extracts  the   value  from  a  character
variable.    If the  value  is  surrounded by  quotes,  the quotes  are
removed.    The  command  may  be  helpful  when  dealing  with spooled
printed values.

A typical series of commands would be:

             DCL       &INPVAL *CHAR LEN(20)
             DCL       &RTNVAL *CHAR LEN(256)
              .
                       /* Assume INPVAL is 'ABC' including the quotes
             EXTVAL    INPVAL(&INPVAL) RTNVAL(&RTNVAL)

The RTNVAL variable would  be ABC without the  quotes.  If INPVAL  does
not have  surrounding quotes,  the same value  is placed in  the RTNVAL
variable.

A 'return value length' is optionally returned.

EXTVAL escape messages you can monitor for
------------------------------------------

      TAA9891    Unbalanced quotes exist at beginning or end

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

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

   INPVAL        The  input  value to  be checked.    A maximum  of 256
                 bytes is supported.

   RTNVAL        The return  value without  leading and  ending  quotes
                 (if they  exist).   The variable  must be  declared as
                 *CHAR LEN(256).

   RTNLEN        An  optional  return variable  that  will  contain the
                 length of the return value  (the position of the  last
                 non-blank).   If used, the  variable must  be declared
                 as *DEC LEN(3 0).

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

Because  EXTVAL  returns a  variable,  it  may only  be  used  in a  CL
program.

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
   ------        ----    ---------      ----------    ----------

   EXTVAL        *CMD                   TAACLRB       QATTCMD
   TAACLRBC      *PGM       CLP         TAACLRBC      QATTCL
					

Added to TAA Productivity tools March 15, 2002


Home Page Up to Top