RMVTRLNULL REMOVE TRAILING NULLS TAACLUF |
The Remove Trailing Nulls command will remove trailing nulls (X'00')
from an input variable and convert them to blanks (X'40') values.
The input variable may be up to 5000 bytes in length. The output
variable must be 5000 bytes. A start position may be named and would
be the length of the input variable in most cases. No embedded nulls
are changed. Trailing blanks are ignored.
A typical series of commands would be:
DCL &INPVAR *CHAR LEN(20)
DCL &OUTVAR *CHAR LEN(5000)
DCL &OUTVAR2 *CHAR LEN(20)
.
RMVTRLNULL INPVAR(&INPVAR) OUTVAR(&OUTVAR) STRPOS(20)
CHGVAR &OUTVAR2 &OUTVAR
The RMVTRLNULL command would change any trailing nulls in &INPVAR to
a blank value. Any trailing blanks in the input variable would be
ignored. Embedded nulls are not removed. If nulls precede trailing
blanks, the nulls would be converted to blanks until a non-null or
non-blank character is found.
The input variable may not be all blank, but may be all null values.
RMVTRLNULL escape messages you can monitor for
----------------------------------------------
None. Escape messages from based on functions will be re-sent.
RMVTRLNULL Command parameters *CMD
-----------------------------
INPVAR The input variable to be checked for trailing nulls.
It may be up to 5000 characters in length. It may
not be all blanks.
Any trailing blanks are ignored.
If null values precede trailing blanks, they will be
removed. The command stops checking for nulls or
blanks when a non-null or non-blank character
exists. If embedded nulls exist prior to a
non-blank or non-null character, the embedded nulls
will remain.
OUTVAR The output variable with trailing nulls removed. It
must be declared as *CHAR LEN(5000).
STRPOS Where to start checking for nulls. 5000 is the
default.
To provide better performance, the value should
typically be the length of the INPVAR value.
Restrictions
------------
Because RMVTRLNULL returns a variable, the command may only be used
in a CL type 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
------ ---- --------- ---------- ----------
RMVTRLNULL *CMD TAACLUF QATTCMD
TAACLUFC *PGM CLP TAACLUFC QATTCL
|
Added to TAA Productivity tools October 15, 2013