TAA Tools
FIXCLENDDO      FIX CL ENDDO                           TAACLRE

The Fix  CL ENDDO command adds  a comment to  the ENDDO commands  in CL
source  that  matches  the  expression  such  as  (&A *EQ  &B)  of  the
corresponding  IF command.   MONMSG commands with  EXEC(DO) are handled
in a  similar manner  with the message  ID added  as a  comment to  the
corresponding ENDDO.   One, generic, or all CL  and CLLE source members
in a source file may be specified.

The  DOWHILE,  DOUNTIL, and  DOFOR commands  are  also processed.   See
later discussion.

By default,  a listing  is produced  for each  source member  processed
and no  source is  changed.   This allows  you to  review what  changes
would be made if OPTION(*UPDATE) was specified.

A typical command would be:

             FIXCLENDDO    MBR(ABC) SRCFILE(QCLSRC)

Member  ABC would  be  ensured to  be a  CL or  CLLE  type.   Any ENDDO
statement  associated  with  previous  DOs  would  be  considered   for
change.  Any changed ENDDOs would be flagged on the listing.

After  reviewing the  output,  you could  change  the source  with  the
command:

             FIXCLENDDO    MBR(ABC) SRCFILE(QCLSRC) OPTION(*UPDATE)

IF Command examples
-------------------

If your IF command is written as:

             IF         COND(&A *EQ &B) THEN(DO)
                 or
             IF         (&A *EQ &B) DO

and  the ENDDO statement  does not have  a trailing comment,  the ENDDO
would be changed to:

             ENDDO      /* (&A *EQ &B) */


Multiple *AND *OR conditions are also handled such as:

             IF         COND((&A *EQ &B) *OR +
                          (&A *EQ &C)) DO

and  the ENDDO  statement does not  have a trailing  comment, the ENDDO
would be changed to:

             ENDDO      /* ((&A *EQ &B) *OR */

Nesting is also considered such as if your code was written as:

             IF         (&A *EQ &B) DO
             IF         (&X *EQ &Y) DO
              .
             ENDDO
             ENDDO

The ENDDOs would be changed to

             ENDDO      /* (&A *EQ &B) */
             ENDDO      /* (&X *EQ &Y) */

Sub expressions on a single statement such as:

             IF         ((&A *EQ &B) *OR (&C *EQ D)) DO

would cause  the  entire  expression to  be  considered for  the  ENDDO
statement.

MONMSG Command examples
-----------------------

If your code was written as:

             MONMSG     MSGID(CPF9898) EXEC(DO)
                    or
             MONMSG     CPF9898 DO

and the  ENDDO statement  does not have  a trailing comment,  the ENDDO
would be changed to:

             ENDDO      /* CPF9898 */

If your code was written as:

             MONMSG     MSGID(CPF9898 CPF9831) EXEC(DO)
              .
             ENDDO

The ENDDO would be changed to

             ENDDO      /* (CPF9898 CPF9831) */

DOWHILE, DOUNTIL, and DOFOR
---------------------------

The  syntax of DOWHILE  and DOUNTIL is  similar to the  IF command, but
an implied DO exists such as:

             DOWHILE      (&A *EQ &B)

              or

             DOWHILE      COND(&A *EQ &B)

When the ENDDO appears, it would pick up the COND value such as:

             DOWHILE      (&A *EQ &B)
              ..
             ENDDO        /* (&A *EQ &B) */

The DOFOR command has a parameter list of:

                VAR     Integer variable used for loop control
                FROM    The From initial value
                TO      The To ending value
                BY      Value to increment loop count

The VAR  value  is used  in  the same  manner  as  the COND  value  for
DOWHILE and DOUNTIL.

Thus a DOFOR group would appear as:

             DOFOR         VAR(&ABC) FROM(1) TO(10) BY(1)
              ..
             ENDDO         /* (&ABC) */

Considerations
--------------

  **   You must have valid CL source such as balanced DO groups.

  **   Source files must be of a length between 92 and 112.

  **   To  use  the   *UPDATE  option,  the  user   must  have  *CHANGE
       authority to the source file.

  **   If  CLLE source  types contain  lower  case, the  statements are
       processed normally.

  **   If an ENDDO statement has an existing comment such as

             ENDDO         /* End of a group */

       it will not be changed.

  **   An ENDDO associated  with an  ELSE command that  specifies a  DO
       for the CMD parameter will not be changed.  For example:

             IF         (&A *EQ &B) DO
              .
             ENDDO      /* End of group */
             ELSE       CMD(DO)
              .
             ENDDO

       The ENDDO associated with the ELSE would not be changed.

  **   An ENDDO associated  with a DO command  that is not on an  IF or
       MONMSG will will not be changed.  For example:

             DO
              .
             ENDDO

  **   If  there  is  insufficient  room  on  the  ENDDO  statement  to
       contain the entire value, it is truncated with '...  */'.

FIXCLENDDO escape messages you can monitor for
----------------------------------------------

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

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

   MBR           The  member  to be  processed.   A specific  member, a
                 generic member name,  or *ALL for  all members may  be
                 specified.

                 If a  generic name or  *ALL is specified,  any members
                 that are not CL or CLLE are ignored.

   SRCFILE       The   qualified  name  of   the  source   file  to  be
                 processed.   The  library  value  defaults  to  *LIBL.
                 *CURLIB may also be used.

   OPTION        The  option to  control  processing.   *PRINT  is  the
                 default  to output  one spooled file  for each  CL and
                 CLLE member processed.   Any statements that would  be
                 changed  by the  *UPDATE option  are  flagged and  the
                 proposed value shown on the ENDDO.

                 *UPDATE  may be specified  to update  the CL  and CLLE
                 members.  No spooled output occurs.

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

See the previous section on Considerations

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

The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     CVTMBRLST       Convert member list
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     RTVDBFA         Retrieve data base file attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSCNT       Send status count
     SNDSTSMSG       Send status message

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

None, the tool is ready to use.

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

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

   FIXCLENDDO    *CMD                   TAACLRE       QATTCMD
   TAACLREC      *PGM       CLP         TAACLREC      QATTCL
   TAACLRER      *PGM       RPG         TAACLRER      QATTRPG
					

Added to TAA Productivity tools June 15, 2004


Home Page Up to Top