PING
0.9
Statistical data handling and processing in production environment
|
Define if a (list of) string(s) can be the ISO-code of a country (e.g., BE, AT, BG,...) or a geographic area (e.g., EU28, EA19, ...), and update this list with geographic areas/countries only.
geo
: a list of string(s) which shall represent(s) and ISO-code or a geographical zone;cds_ctryxzone
: (option) configuration file storing the description of geographical areas; by default, it is named after the value &G_PING_COUNTRYxZONE
(e.g., META_COUNTRYxZONE
); for further description, see %meta_countryxzone;clib
: (option) name of the library where the configuration file is stored; default to the value &G_PING_LIBCFG
(e.g., LIBCFG
) when not set;sep
: (option) character/string separator in input geo
list; default: %quote( )
, i.e. sep
is blank._ans_
: (option) name of the macro variable storing the list of same length as geo
where the i-th item provides the answer of the test above for the i-th item in geo
, i.e.:1
if it is the ISO-code of a country (e.g., geo=DE
, geo=CH
, geo=TR
, ...),2
if it is the code/acronym of a geographic area (e.g., geo=EU28
, or geo=EFTA
,..),0
otherwise; either this option or the next one (_geo_
) must be set so as to run the macro;_geo_
: (option) name of the macro variable storing the updated list from which all non-geographical areas or countries have been removed; _geo_
stores, in this order, first countries, then geographical zones.Let us consider the following simple example:
which returns ans=1 1 0 2 1 2
and geo=AT BE FR EU28 EA19
.
Run macro %_example_str_isgeo
for more examples.
Testing all at once if a list geo
of strings are actual geographic codes (instead of testing it separately for each item of the list) avoids the burden of multiple IO operations on the input cds_ctryxzone
configuration dataset.
%zone_to_ctry, %ctry_to_zone, %ctry_in_zone, %meta_countryxzone.