TAA Tools
ADJAPOST        ADJUST APOSTROPHES                     TAAIFTU

The Adjust  Apostrophes command  is designed  to adjust  the number  of
apostrophes  in a  variable  so that  the  return result  is  valid for
command   processing.    ADJAPOST  is  specifically  designed  for  IFS
processing, but may be used for variables intended for non-IFS use.

For non-IFS use, you may prefer the CHKAPOST tool.

ADJAPOST accepts  a 5000  byte input  string  and returns  a 5000  byte
return  variable.    A typical  series  of  commands  would be  to  use
ADJAPOST  after accessing  an IFS  object name.   If the  name contains
apostrophes and  you  want to  process  the  object name  with  another
constructed  command  (such   as  DLTIFS2),  the  following   would  be
typical:

             DCL       &PATH *CHAR LEN(5000)
             ADJAPOST  'dir/abc.txt' *QUOTE &PATH
             DLTIFS2   OBJ(&PATH)

The  actual length of  the INPUT  variable would be  calculated because
of the default INPUTLEN(*CALC).

The ACTION  parameter determines  how many  apostrophes to  produce  in
the output variable.

ADJAPOST escape messages you can monitor for
--------------------------------------------

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

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

   INPUT         The input  string of up  to 5000 bytes  that is to  be
                 adjusted.    It  may  or  may not  include  unbalanced
                 apostrophes.

   ACTION        The  action  to  be  performed  if  an  apostrophe  is
                 found.

                 *TIMES2  may  be  entered  to  double  the  number  of
                 apostrophes.

                 *TIMES4  may be  entered  to quadruple  the number  of
                 apostrophes.

                 *TIMES2PL2  may  be entered  to double  the  number of
                 apostrophes and then add 2 more.

                 *TIMES4PL4 may be entered  to quadruple the number  of
                 apostrophes and then add 4.

                 *DIVBY2  may  be  entered  to  divide  the  number  of
                 apostrophes  by 2.   If an  odd number  of apostrophes
                 exists, the  value  is  calculated as  (n-1)/2.    For
                 example,   if    three   apostrophes   exist    before
                 conversion,  one would exist  after conversion.   If a
                 single   apostrophe  existed   it  would   be  removed
                 entirely.

                 *QUOTE may be  entered to fully  enclose the input  in
                 apostrophes.      This   will  double   any   internal
                 apostrophes.    This is  equivalent  to  using *TIMES2
                 and then enclosing the result in apostrophes.

                 *UNQUOTE may  be  entered  undo  the  action  done  by
                 *QUOTE.  This is a synonym for *DIVBY2.

   OUTPUT        The converted output  string to be returned.   This is
                 a required  return parameter.  It  must be declared as
                 *CHAR LEN(5000).  If  the return code  is not OK  then
                 this value is unchanged.

   OUTPUTLEN     The length  of the converted  output string.   This is
                 an  optional return  parameter  that if  used  must be
                 declared  as *DEC  LEN(10 0).   If the  return code is
                 not OK then this value is unchanged.

   RTNCDE        The  return  code.    Either  OK,  INVACTION  (invalid
                 action),  or   TOOLONG  (result  too   long)  will  be
                 returned.   This is an  optional return parameter that
                 must be declared as *CHAR LEN(10) if used.

   INPUTLEN      The input  length.   *CALC is  the default.   It  will
                 determine the  length after trimming  trailing blanks.

                 A specific  length of 1 to 5000  may be entered.  This
                 can be used to cause  trailing blanks to be  included.


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

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

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

None.

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

None, the tool is ready to use.

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

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

   ADJAPOST      *CMD                   TAAIFTU       QATTCMD
   TAAIFTUR      *PGM       RPGLE       TAAIFTUR      QATTRPG
					

Added to TAA Productivity tools October 15, 2009


Home Page Up to Top