![]() |
PING
0.9
Statistical data handling and processing in production environment
|
Generate a quoted text that can be interpreted by the AS clause of a SQL procedure.
dsn : a dataset reference;var : list of fields/variables that will be added to dsn through 'ADD' clause;as : (option) list of alias (AS) to use for the variables in var; if not empty, then should be of same length as var; default: empty, i.e. the names of the variables are retained;op : (option) list of unary operations (e.g., min, max, ...) to run (separately) over the list of variables in var; if not empty, then should be of same length as var; note that the string _ID_ (see also variable G_PING_IDOP) is used for the identity operation (i.e., no operation); default: empty, i.e. _ID_ is used for all variables;lib : (option) name of the input library; by default: empty, i.e. WORK is used._as_ : name of the macro variable storing the SQL-like expression based on var, as, and op input parameters and that can be used as is in an AS expression.
The simple example below:
returns asexpr=max(a) AS ma, b, min(h) AS mh.
%ds_select, %sql_clause_where, %sql_clause_case, %sql_clause_add, %sql_clause_by, %sql_clause_modify.