The Print CLP Do Groups command prints an indented listing of CL
source to describe where the DO groups are. The intent of the
command is to provide a visual picture of what the code looks like
which can be helpful when attempting to understand the logic of a
program. The command is also useful when CRTCLPGM fails on an
unmatched DO group.
A typical command would be:
PRTCLPDO MBR(xxx)
The member from the default QCLSRC source file would be printed. The
output spooled file would have the same name as the member.
By default, the spooled file is immediately displayed based on a
command parameter.
The printed output is divided into three areas.
** Label area
** Command area
** Parameter area
The source is shifted to match these areas. Within the command area,
the commands are offset to the right and indicated with an
indentation character (default is *) to show the DO groups. By
default, 2 spaces are used for each indication group (you may specify
3 or 4). Unmatched ENDDO commands are indicated.
Most DO commands are found regardless of whether they occur as a
separate command or embedded within an ELSE, MONMSG, or IF command.
See the later section.
The command differs from the tool DSPCLPDO in that it indents the DO
groups rather than just numbering them.
Command parameters *CMD
------------------
MBR The member to be printed. It must be a CLP or CLLE
type.
SRCFILE The qualified file name of the source file. The
file name defaults to QCLSRC. The library value
defaults to *LIBL. *CURLIB may also be specified.
INDCHR The character to be used to display indentation. *
is the default.
INDSPC The number of spaces to indent. 2 is the default.
3 or 4 may be specified. Increasing the number
provides better readability, but reduces the number
of indentation levels that may be seen.
FROMSTMT The From statement to print source records from.
*FIRST is the default for the first record in the
member. A source sequence number may be entered
such as 100 or 100.00.
TOSTMT The To statement to print source records to. *LAST
is the default for the last record in the member. A
source sequence number may be entered such as 110 or
110.00.
DSPSPLF An option to determine whether DSPSPLF should be
used at the completion of the command.
*YES is the default and uses DSPSPLF to display the
spooled file. No page headings occur to allow
better viewing of indentations. The spooled file is
automatically deleted when you end DSPSPLF. If
specified in a batch job, *NO is assumed.
*NO causes the spooled file to be output for later
printing or displaying. Page headings occur for
each page.
Identifying DO Commands
-----------------------
A comment that exists before a command must end prior to position 14
of the source record. Otherwise the command will not be recognized.
Any DO groups as separate commands (not embedded commands) are
correctly identified. DOWHILE, DOFOR, and DOUNTIL are also
supported.
The following describes the checking when the DO is embedded.
ELSE A DO is checked for by scanning for CMD(DO), DO, or
(DO). No comment can appear between the ELSE and
the DO. The DO must appear in the same source
record as the ELSE.
MONMSG A DO is checked for by scanning for EXEC(DO). The
keyword form must be used. Because the MONMSG
command has other parameters that appear before
EXEC, it is normal to code the EXEC keyword.
IF A DO is only checked if the combination of left and
right parenthesis balance. At that point a check is
made for THEN(DO), DO, or (DO).
A parenthesis within quotes such as ')' will not be
counted to determine if the parenthesis balance.
This allows programs that scan for a parenthesis to
be properly evaluated.
Restrictions
------------
See the previous comments on identifying DO commands.
Prerequisites
-------------
The following TAA Tools must be on your system:
HLRMVMSG HLL Remove message
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDSTSMSG Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
PRTCLPDO *CMD TAACLQA QATTCMD
TAACLQAC *PGM CLP TAACLQAC QATTCL
TAACLQAR *PGM RPG TAACLQAR QATTRPG
|