On 07-Jan-2015 10:22 -0600, Mr. K.V.B.L. wrote:
> Why am I getting this? Using V7R1 here in a CL program. According
> to the documentation, %LEN() should exist.
The above was commented-on\explained already by others. However, I
will add:
I did not find that doc. Be aware that the KnowledgeCenter allows
multiple release documents to be searched [via "Search Filters"], and
each of the links presented for a search are denoted with the release.
If there is an IBM i 7.1 doc link, then probably worth posting that link
for clarification.
> All I want to do is test a parameter for empty string.
The CL has no concept of an "empty string", so the typical test of a
*CHAR parameter is to compare the value of the fixed-length character
data type [i.e. not a /string/ data type] with a /blank/ character using
the following predicate:
COND(&CHAR_CLVAR *EQ ' ')
If the CL is coded to map an effective\logical VarChar data type to
simulate what might better be described as a string data type, then the
code can review the length portion of the data-structure to determine
the length [or easily set the length]; e.g.:
dcl &varchar *char len(502)
dcl &vc_len *int len( 2) stg(*defined) defvar(&varchar 1)
dcl &vc_data *char len(500) stg(*defined) defvar(&varchar 3)
if cond(&vc_len *eq 0) /* empty string */
...
chgvar (&vc_len) value(0) /* set &varchar as empty string */
--
Regards, Chuck