TAA Tools
DMOCTLLVL       DEMO CONTROL LEVEL                     TAARPHN

The  Demo Control  Level  tool provides  a  demonstration and  standard
source  that can  be copied to  provide a  procedural RPG  program that
handles  up  to 3  control breaks.   After  copying  the source,  use a
source  editor and  follow  the  instructions  for how  to  modify  the
source for your requirements.

Some  users prefer  to write  procedural programs  rather than  use the
functions  of the RPG cycle  to perform control  level processing (L1 -
L9).   Properly coding a  procedural solution  for all  of the  control
level considerations  is not  a simple function.   The  standard source
will  allow  you  to  quickly  create  a  program  that can  be  easily
tailored to your requirements.

To use the demonstration version  enter DMOCTLLVL with the desired  RPG
type (both types produce the same results).

            DMOCTLLVL    RPGTYPE(nnn)

Objects from the TAATOOL  library and QUSRSYS are copied  to an outfile
using  DSPOBJD (QADSPOBJ  model  file in  QSYS  with a  format  name of
QLIDOBJD).    The data  is then  sequenced using  OPNQRYF to  allow the
proper control  level  processing.   The  results  are printed  by  the
standard source with 3 control breaks:

        Level  Description      Field name
        -----  -----------      ----------

        L3     Library name     ODLBNM
        L2     Object type      OBODTP
        L1     Attribute        OBODAT

Copying the source for your use
-------------------------------

To  copy  the standard  source  to your  source  member,  use a  source
editor  browse mode or the  DUPSRC command.  Select  the member to copy
for RPG III or RPG IV use:

     RPG Type      Member        Source file    Library
     --------      ------        -----------    -------

       III         TAARPHNR      QATTRPG        TAATOOL
       IV          TAARPHNR2     QATTRPG        TAATOOL

Use the source  editor to scan  for ++REQ and  follow the  instructions
for how to modify  the program.  For example, you will  need to specify
the  number of  control levels  you want (up  to 3),  the names  of the
fields  to  be  used   as  the  control  fields,   the  fields  to   be
accumulated, output formatting, etc.

After  you  are  satisfied  that  you  have   a  working  program,  use
RMVSRCCMT to remove the +++ comments:

            RMVSRCCMT   MBR(mmm) SRCFILE(fff)

Detail or total printing
------------------------

An  option exists in  the source  to print  the detail lines  (one line
for each record read) or to print totals only.

Spacing
-------

If  detail  printing is  used,  there is  one  space after  each detail
line, one before an L1 total and 2 after each total line.

If 'totals  only' are  printed, there  is  one space  after each  total
line.

The  ZZCURL field  will contain  the current  line number  on  the page
(from  the  PRTCTL data  structure)  to  allow skipping  if  many total
lines may appear at the end of the page.

DMOCTLLVL escape messages you can monitor for
---------------------------------------------

None.

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

   RPGTYPE       The RPG Type  to use  for the  demonstration.   Either
                 type  produces the  same result.   IV  is the  default
                 for RPG IV.  III may be used for RPG III.

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

Up to 3 levels of control may be specified.

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

The following TAA Tools must be on your system:

     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDSTSMSG       Send status message

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

The demonstration  is ready to use.   You must copy the  RPG III or RPG
IV  source  member  and  make  modifications  for  your  own   specific
version.

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

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

   DMOCTLLVL     *CMD                   TAARPHN       QATTCMD
   TAARPHNC      *PGM       CLP         TAARPHNC      QATTCL
   TAARPHNR      *PGM       RPG         TAARPHNR      QATTRPG
   TAARPHNR2                RPGLE       TAARPHNR2     QATTRPG
					

Added to TAA Productivity tools July 10, 2000


Home Page Up to Top