TAA Tools
EXPVAL     EXPAND VALUE                                 TAACLQE

The Expand  Value command  is intended  for the situation  where a  RTV
command  returns a list  of values  in a  single variable that  may not
have  a  space between  the  values and  you want  to  use the  list in
QCMDEXC.

For example,  the RTVUSRPRF command  returns the  SUPGRPPRF value as  a
list of  up to  15 user profile  names in a  150 byte  return variable.
To  use  the  list in  QCMDEXC,  there must  be  blanks  separating the
values.  EXPVAL puts the blanks in for you.

The coding would be as:

             DCL        &OUTVAR *CHAR LEN(1000)
             DCL        &SUPGRPPRF *CHAR LEN(150)
              .
             RTVSYSVAL  SUPGRPPRF(&SUPGRPPRF)
             EXPVAL     INPVAR(&SUPGRPPRF) OUTVAR(&OUTVAR) VALLEN(10)
              .
             CALL       QCMDEXC PARM(...SUPGRPPRF(' *CAT +
                          &OUTVAR *TCAT ')' ...)

EXPVAL bumps through the  input variable.  Each  value is moved to  the
output based  on the  length.  After  each value is  moved, a  blank is
inserted into the output.

When an all blank input value exists, the command ends.

An option  exists to allow the  values to be trimmed  off when they are
returned (the  blank separator  still  exists).   This may  be  helpful
when using the return value in a message.

The OUTVAR2 parameter allows for 5000 bytes to be returned.

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

   INPVAR        The input  variable.   It  may be  up  to 5000  bytes.
                 The length  of each value is determined  by the VALLEN
                 parameter.   The first all  blank value determines the
                 end  of   the  list.     No  other   values  will   be
                 considered.

   OUTVAR        The  return  variable for  the  expanded  value.   The
                 output  will   appear  with  a  blank  following  each
                 value.   This  is an  optional  return value  that  if
                 used must be specified as *CHAR LEN(1000).

   OUTVAR2       The  return variable  for  the  expanded value.    The
                 output  will   appear  with  a  blank  following  each
                 value.   This  is an  optional  return value  that  if
                 used must be specified as *CHAR LEN(5000).

   VALLEN        The length of each value.  The default is 10.

   TRIM          A  *YES/*NO value  for whether  the  values should  be
                 trimmed off so there are not excess blanks.

                 The  default  is   *NO  meaning  the  values  are  not
                 trimmed.    For example,  if VALLEN(10)  is specified,
                 each value  will  appear as  10  bytes followed  by  a
                 blank or 11 positions for each value.

                 *YES may  be specified so if the  values have trailing
                 blanks,  they will  be  trimmed off.   A  single blank
                 will  separate  the  values.    This  option   can  be
                 helpful if  you are placing  the values in  a message.

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

Because  the command returns a  variable, it can  only be used  in a CL
program.

The first all blank entry ends the command.

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

None.

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

None, the tool is ready to use:

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

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

   EXPVAL        *CMD                      TAACLQE        QATTCMD
   TAACLQEC      *PGM          CLP         TAACLQEC       QATTCL
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top