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
command (such as DLTIFS2), the following would be typical:

             DCL       &INPUT *CHAR LEN(5000)
             DCL       &OUTPUT *CHAR LEN(5000)
              .
             ADJAPOST  INPUT(&INPUT) OUTPUT(&OUTPUT)
                         ACTION(*TIMES2)
             DLTIFS2   OBJ(&OUTPUT)

The actual  length of the &INPUT  variable would be  calculated because
of  the  default  INPUTLEN(*CALC).   Specifying  an  actual length  (if
known) would provide better performance.

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 3  apostrophes  exist before  conversion,
                 one would exist after conversion.

   OUTPUT        The converted  output string to be returned.   This is
                 a  required return parameter.   It must be declared as
                 *CHAR LEN(5000).

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

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

   INPUTLEN      The input length.  *CALC is the default.

                 A  specific  length  of  1  to  5000 may  be  entered.
                 Better performance will occur  if the input length  is
                 known.


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

Because  the  CHKAPOST  command returns  one  or  more  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