PING
0.9
Statistical data handling and processing in production environment
|
Define if a (list of) string(s) actually define variables in a given dataset.
%str_isvar(dsn, var, _ans_=, _var_=, lib=WORK, sep=%str( ));
dsn
: a reference dataset;var
: list of string elements to be from the dataset when they exist;lib
: (option) name of the input library; by default: WORK
is used;sep
: (option) character/string separator in input var
list; default: %str( )
, i.e. sep
is blank._ans_
: (option) name of the macro variable storing the list of same length as var
where the i-th item provides the answer of the test above for the i-th item in var
, i.e.:1
if it is the name of a variable in var
,0
if not; either this option or the next one (_var_
) must be set so as to run the macro;_var_
: (option) name of the macro variable storing the updated list from which all elements that do not macth existing variables/fields in dsn
have been removed.Let us consider the table _dstest5
:
f | e | d | c | b | a |
---|---|---|---|---|---|
. | 1 | 2 | 3 | . | 5 |
then:
returns ans=1 1 0 0 1
and list=a b c
, the only string elements of var
which define variables in _dstest5
.
Run macro %_example_str_isvar
for more examples.
var
with the list of variables in dsn
, i.e. running:var
.var
matches a variable in dsn
, an empty list is set.