SCNVARRGT2 SCAN VARIABLE RIGHT 2 TAACLTT |
The Scan Variable Right 2 command scans a variable (up to 5000 bytes)
for either the length of the data or for a string. SCNVARRGT2 can
help determine the length of the data in a large variable or where a
string of characters begins.
SCNVARRGT is a similar tool for smaller variables (up to 500 bytes).
The RTVVALA command is a similar tool for variables up to 50 bytes
and also provides more return values such as the type of data,
whether it is a name, etc.
A typical series of SCNVARRGT2 commands would be:
DCL &RTNPOS *DEC LEN(5 0)
.
SCNVARRGT2 VAR(&xxx) RTNPOS(&RTNPOS)
STRING(*NONBLANK)
Or to scan for a string of ABC:
SCNVARRGT2 VAR(&xxx) RTNPOS(&RTNPOS)
STRING(ABC)
SCNVARRGT2 escape messages you can monitor for
----------------------------------------------
None. Escape messages from based on functions will be re-sent.
SCNVARRGT2 Command parameters *CMD
-----------------------------
VAR The character variable to be scanned. It can be all
blank. A maximum of 5000 bytes is supported, but
the variable can be shorter in length.
RTNPOS The return position for where the value was found.
It must be declared as *DEC LEN(5 0). If not found,
a zero is returned (not an escape message). If a
string is specified, the leftmost position that
matches is returned.
STRPOS The rightmost start position to begin the scan from
the right. The default is 5000. To improve
performance of the scan, specify the length of the
VAR value that is being scanned. It must be a
number between 1 and 5000. The STRPOS value minus
the length of the STRING value must be greater than
or equal to 0.
STRING The string to scan for. The default is *NONBLANK
which means the rightmost non-blank character. A
string of up to 20 characters can be specified. If
a string is specified, trailing blanks are trimmed
off to determine the length of the compare. An all
blank string is invalid and an escape message will
be sent.
To scan for an embedded blank, surround the string
with quotes such as 'A C'.
To scan for lower case, surround the string with
quotes such as 'abc'.
Restrictions
------------
Because SCNVARRGT2 returns a parameter, the command may only be used
in CL program.
Prerequisites
-------------
The following TAA Tools must be on your system:
SNDESCINF Send escape information
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SCNVARRGT2 *CMD TAACLTT QATTCMD
TAACLTTC *PGM CLP TAACLTTC QATTCL
|
Added to TAA Productivity tools July 15, 2011