TAA Tools
CHKCLSPE        CHECK CL SPELLING                      TAATXTJ

The Check  CL Spelling  command checks  words within quotes  in any  CL
type source.   For example, words within  parameter values for keywords
such  as TEXT or MSG  can be checked for  misspellings.  A spooled file
is created if  any spelling errors  exist.  The  QTWCHKSP API is  used.
Unique  spelling  dictionaries  can   be  created  with  the  CRTSPADCT
command which is part of the Operating System.

Special  dictionaries  are supplied  with the  TAA  Productivity Tools.
See the discussion with the TAADCT TAA Tool.

The command operates  on either  a single  member or all  members in  a
file such as:


If MBR(*ALL)  is requested, a summary  spooled file is output  with one
line per member.

The  spelling dictionaries  used  may be  specified on  the  command or

Technique used

A CL  statement may  be made  up  of one  or more  source lines.    The
statement is assembled in  a work area and then words  inside of quotes
are  extracted  to a  second  work  area.   Words  within comments  are
bypassed.   If two consecutive  quotes are found, one  is output to the
second work area.   When all  words to be  checked have been  extracted
from a  source statement, the second  work area is passed  to the Spell

If  a word is  found inside quotes  such as 'mssage' the  error word is
printed along with  the first  or only  source line that  makes up  the
statement and  its sequence  number.  If  the misspelled  word is  on a
continuation  source line  the  context of  the spelling  error  is not
shown.  You  must review the  source itself  to see the  error word  in

It is  valid to split a  word over two  source lines (the  first ending
with a + continuation) and have the word validly checked.

After each  ending quote, it  is assumed a  word has ended  and a blank
is  added to  prevent the  next word  from being concatenated  with the
first.  For example, if you specify:

          'Hello' *CAT 'friend'

both words would pass the spell checker.  However if you specify:

          'fr' *CAT 'iend'

both words will be flagged as misspelled.

A source member  can be  up to 240  bytes in record  length.  Only  the
first 97  bytes of  the source  statement field will  be printed  if an
error occurs.

If  MBR(*ALL) is specified, a change date  may be entered so only those
members  which  have  been  changed  after  the  change  date  will  be

Because of the technique used, the following will occur:

  **   It  is possible  to  have  text within  a  keyword  that is  not
       surrounded   by   quotes.     For   example,   you   might  have
       TEXT(TESTFILE).  The text will not be checked in this case.

  **   It is also possible to place  quotes around a value that is  not
       text such as FILE('ABC').   In this case ABC  will be considered
       a  misspelled word.   You should  expect some degree  of 'noise'
       with CHKCLSPE.

You  can reduce the amount of 'noise'  by creating a dictionary of your
typical abbreviations.


The performance of the spell check  API is not as good as that  used by
the  Office Editor or  Text Management.   You  should not  expect great
performance from CHKCLSPE.

The API has significant overhead to begin checking.

While spell checking is occurring, the CPU is very busy.

CHKCLSPE escape messages you can monitor for

      TAA9891    Not a CMD source type or not CMD types exist
      TAA9892    Spelling errors - only if ESCAPE(*YES)

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

Command parameters                                    *CMD

   SRCFILE       The  qualified  file name  of  the source  file  to be
                 checked.  QCLSRC  is the default.   The library  value
                 defaults to *LIBL.  *CURLIB may also be specified.

   MBR           The member to  be spell checked.  *ALL  is the default
                 to  check all members  in the  file.  A  single member
                 or a generic member name may be specified.

   SRCTYP        The  source  type  to  be  checked.    *ANYCL  is  the
                 default to  check any source  types of CL,  CLP, CLLE,
                 CL38,  and  CLP38.   An  individual type  may  also be

   DLTSPLF       Determines  if  the  spooled file  is  deleted  if the
                 correct  spelling  exists.     *YES  is  the   default
                 meaning  to  delete  the  spooled file  if  no  errors
                 exist.   The  current  implementation does  not output
                 the spooled file unless spelling errors occur.

                 *NO may  be  specified  to  retain  the  spooled  file
                 whether spelling errors exist or not.

   CHGDATE       If MBR(*ALL)  is specified,  any date entered  will be
                 checked  against the last change  date of each member.
                 If the  member  was changed  on  or after  the  change
                 date, it  will be  checked.   Members which were  last
                 changed  before  the  change  date will  be  bypassed.
                 The  change  date (if  any) should  be entered  in job

                 The  intention   of  the   CHGDATE  parameter  is   to
                 minimize the  performance once  an entire  source file
                 is  checked.   After  that point,  you may  just check
                 the members that have  changed by specifying a  change

   ESCAPE        A  *YES/*NO value  for  whether  to send  the  TAA9892
                 message  as an escape  type if  spelling errors exist.
                 *YES is the default.

                 *NO  may  be   specified  to   receive  a   completion

   DICT          The qualified  name of the  spelling dictionary  to be
                 used.   The  default is  *DFT which  means to  use the
                 DCTARA parameter.

                 A  list  of up  to  8 dictionaries  may  be named.   A
                 dictionary must be  created by the CRTSPADCT  command.

   DCTARA        An   optional  parameter   that  allows   a  list   of
                 dictionaries  to be  specified by  naming a  data area
                 in  library  TAADCT  that  contains  the  list.    The
                 default is  *DFT.  A  data area  may only be  named if
                 DICT(*DFT) is used.

                 If  a  dictionary  is  named,  DCTARA(*NONE)  must  be

                 The list  of dictionaries  must be  entered  according
                 to  the   CRTDCTARA  TAA  Tool   and  the   data  area
                 containing the  dictionaries must exist  in the TAADCT
                 library.   Up  to 8 dictionaries  may be  named in the
                 data area.

                 If both  DICT(*DFT)  and DCTARA(*DFT)  are  specified,
                 the following rules exist.

                 1) If  the library TAADCT  does not exist,  the TAADFT
                 dictionary in TAATOOL is used.

                 2)  If the TAADCT  library exists, a data  area by the
                 name of  the  user  of  the job  is  searched  for  in
                 TAADCT.   If it  does not  exist, a  data area by  the
                 name of SYSTEM is searched for in TAADCT.

                 3)   If   neither  data   area   exists,   the  TAADFT
                 dictionary in TAATOOL is used.


You must have valid CL specifications.

See the  previous discussion  on the  technique used  to determine  the
words to be checked.


The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     CHKJOBCTL       Check *JOBCTL special authority
     CVTMBRLST       Convert member list
     EDTVAR          Edit variable
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message


None, the tool is ready to use.

Objects used by the tool

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

   CHKCLSPE      *CMD                   TAATXTJ       QATTCMD
   TAATXTJC      *PGM       CLP         TAATXTJC      QATTCL
   TAATXTJR      *PGM       RPG         TAATXTJR      QATTRPG
   TAATXTJR2     *PGM       RPG         TAATXTJR2     QATTRPG

Added to TAA Productivity tools April 23, 2001

Home Page Up to Top