TAA Tools
FIXVAR          FIX VARIABLE                           TAACLTU

The Fix  Variable command  allows an  input variable to  be changed  by
replacing  a  character with  one  or  more characters  (up  to 10)  or
deleting  a  character.   The  new value  is  returned in  a  5000 byte
variable.  The  input variable may  be up to 5000  bytes, but a  length
should be specified to improve performance.

A typical series of commands would be:

             DCL        &VAROUT *CHAR LEN(5000)
              .
             FIXVAR     VARIN(&xxx) FROMCHAR(A) TOCHAR(B) +
                          VAROUT(&VAROUT) VARINLEN(nn)
             CHGVAR     &yourvar &VAROUT

The VARIN value  would be scanned and if any 'A's  exist, they would be
replace  with 'B's  and returned  in the &VAROUT  variable.   You would
normally want to move  the beginning bytes  of &VAROUT to the  variable
you want as the result of FIXVAR.

You may also:

  **   Replace a character with the special value *BLANK.

  **   Delete a character with the special value *DELETE.

  **   Replace a character with up to 10 characters.

FIXVAR is intended for 'character' data.

FIXVAR escape messages you can monitor for
------------------------------------------

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

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

   VARIN         The input  variable.  It can  be up to 5000  bytes and
                 cannot be all blanks.

   FROMCHAR      The  From character  to scan  for.   Any value  may be
                 entered.

                 The special value *BLANK may  be used to mean a  X'40'
                 value.   Note that the  length of  the VARIN value  is
                 determined  by the  last non-blank.    Therefore, when
                 using  *BLANK, any trailing blanks  in the VARIN value
                 will not be converted to the TOCHAR value.

   TOCHAR        The To character  to replace the From  character with.
                 Up to 10 characters may be entered.

                 The special value  *BLANK may be used to  mean a X'40'
                 value should be inserted.

                 The  special value  *DELETE may  be used to  cause the
                 From character to be  deleted in the return  variable.
                 Any remaining characters are shifted to the left.

   VAROUT        The  return output  variable.    A variable  of  *CHAR
                 LEN(5000)  must  be  specified.    You would  normally
                 want to move  the beginning  bytes of  &VAROUT to  the
                 variable you want as the result of FIXVAR.

   VARINLEN      The length of the  input variable.  A default  of 5000
                 is  used.    Better  performance  can be  achieved  by
                 specifying  the  actual length  of the  variable being
                 used.   The value is  used to  determine where a  scan
                 should  begin for  the  rightmost non-blank  character
                 of the VARIN value.

                 An  escape message will be sent  if data exists in the
                 VARIN  value  to  the  right  of  the  VARINLEN  value
                 specified.


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

  **   The input variable cannot be all blanks.

  **   If multiple characters  are specified for the  TOCHAR value, the
       length of the data to be generated cannot exceed 5000 bytes.

  **   Because  FIXVAR  returns a  variable,  the command  may  only be
       used in a CL program.

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

The following TAA Tools must be on your system:

     SCNVARRGT2      Scan variable right 2
     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
   ------        ----    ---------      ----------    ----------

   FIXVAR        *CMD                   TAACLTU       QATTCMD
   TAACLTUC      *PGM       CLP         TAACLTUC      QATTCL
					

Added to TAA Productivity tools July 15, 2011


Home Page Up to Top