CHKGENERC CHECK GENERIC VARIABLE TAACLPA |
The CHKGENERC command checks a variable to see if it contains a
generic value (e.g. PAY*). A return value contains Y or N. An
optional return value returns the same variable without the *.
This command is helpful when you are writing your own commands that
deal with generic values. The command definition PARM statement
would normally be coded:
PARM KWD(FILE) TYPE(*GENERIC) LEN(10) ...
The typical use of the command is as follows:
CHKGENERC VAR(&FILE) GENERC(&GENERC)
IF (&GENERC *EQ 'Y') DO /* Generic value */
.
. Process generic value
.
ENDDO /* Generic value */
If you want the file parameter without the * then you would specify:
CHKGENERC VAR(&FILE) GENERC(&GENERC) RTNVAR(&NEWFILE)
The &NEWFILE variable would contain the file name without the
trailing *. This may be helpful based on your processing
requirements.
You may also use the same variable for the VAR and RTNVAR parameters
such as:
CHKGENERC VAR(&FILE) GENERC(&GENERC) RTNVAR(&FILE)
The command can also be used to determine the length of a name. The
RTNLEN parameter will always provide the length of the name whether
it is generic or not.
If a special value (such as *ALL) may be specified, you may bypass
the checking with SPCVAL(*YES).
Command parameters *CMD
------------------
VAR This is a 10 character field that will be checked
for a generic value.
GENERC This is a required return value which must be
defined as *CHAR LEN(1). It will contain a Y or N
to describe if the variable is generic.
RTNVAR This is an optional return variable which will
contain the variable value without the *. It must
be specified as *CHAR LEN(10). If the variable to
be checked is not generic, this return variable will
be identical. The same variable as used with the
VAR parameter can be used.
RTNLEN This is an optional return variable which will
contain the length of the variable value without the
*. It must be specified as *DEC LEN(5 0). If the
value of VAR is not generic, the length of the field
is still returned.
SPCVAL A *YES/*NO value for whether the name to be checked
may contain a special value such as *ALL. *NO is
the default meaning the value to be checked must be
a valid name or valid generic name (no special
values exist).
*YES may be specified to bypass the checking if the
value starts with an *. If the value starts with an
*, an 'N' is returned for the GENERC parameter. If
the value does not start with an *, it is checked as
a valid name or generic name.
Call interface that does not adopt
----------------------------------
A second program is provided TAACLPAC2 that performs the same
function, but operates without adopting any authority.
The CALL interface is:
DCL &VAR *CHAR LEN(10)
DCL &GENERC *CHAR LEN(1)
DCL &RTNVAR *CHAR LEN(10)
DCL &RTNLEN *DEC LEN(5 0)
.
CALL PGM(TAATOOL/TAACLPAC2) +
PARM(&VAR &GENERC &RTNVAR &RTNLEN)
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ----- --------- ---------- -----------
CHKGENERC *CMD TAACLPA QATTCMD
TAACLPAC *PGM CLP TAACLPAC QATTCL
TAACLPAC2 *PGM CLP TAACLPAC QATTCL
|
Added to TAA Productivity tools April 1, 1995