PING
0.9
Statistical data handling and processing in production environment
|
Transform an unformatted list of items (e.g. considered as char) into a list of comma-separated and/or quote-enhanced items.
list
: a list of blank separated items/char;mark
: (option) character/string used to quote the items in the output list; default: mark
is the double quote "; any type of character can be used, though the macros %str/%quote
should be employed to pass it in practice (see examples and notes below); note also the particular case where it is passed as mark=_EMPTY_
then it is set to mark=%quote()
;sep
: (option) character/string separator in input list; default: %quote( )
, i.e. sep
is blank;rep
: (option) character/string used to replace the separator in the output list; default: %quote(,)
, i.e. the output list is comma separated; note that rep=_BLANK_
can also be passed so as to set rep=%quote( )
.clist
: output formatted list of items, e.g., comma-separated items/char in between quotes..
With the default settings mark=%str(%"), sep=%quote( ), rep=%quote(,)
, the following command:
returns: clist="DE","AT","BE","NL","UK","SE"
, while:
returns: clist=DE,AT,BE,NL,UK,SE
, and:
returns: clist=*DE* *AT* *BE* *NL* *UK* *SE*
.
Finally, note also the following use:
with returns per_var=AGE*RB090*HT1*QITILE
.
Run macro %_example_list_quote
for more examples.
%quote
or %str
when the marks/separators are special characters (since it takes effect during macro compilation/execution).mark
, rep
and sep
, this is roughly equivalent to running:%clist_unquote, %sql_list, TRANWRD, COMPBL, COMPRESS, BQUOTE.