PING  0.9
Statistical data handling and processing in production environment
obs_select

Select a given observation/set of observations in a dataset.

%obs_select(idsn, odsn, var=, where=, ilib=WORK, olib=WORK);

Arguments

  • idsn : a dataset reference;
  • var : (option) list of fields/variables of idsn upon which the extraction is performed; default: var is empty and all variables are selected;
  • where : (option) expression used to refine the selection (WHERE option); should be passed with %str; default: empty;
  • ilib : (option) name of the input library; by default: empty, i.e. WORK is used;
  • olib : (option) name of the output library; by default: empty, i.e. WORK is also used.

Returns

  • odsn : name of the output dataset (in WORK library); it will contain the selection operated on the original dataset;

Examples

Let us first consider test dataset #34:

geo year ivalue
EU2720061
EU2520042
EA1320013
EU2720074
... ... ...

then by the condition one or more rows are selected from the dataset, e.g. using the instructions below:

%let var=geo;
%let obs=EA13;
%obs_select(_dstest34, TMP, where=%str(&var="&obs"));

so as to store in the output dataset odsn the following table:

geo year ivalue
EA1320013

Run %_example_obs_select for more examples.

See also

%ds_select, %obs_count.