New to SAS. I know the following codes are creating a macro variable that stores a list of variables names, but what do : and | mean?
%let v_lst = a b bb: t_v129 |
c tt: t_v16 t_v275 |
d: t_v56 |
;
New to SAS. I know the following codes are creating a macro variable that stores a list of variables names, but what do : and | mean?
%let v_lst = a b bb: t_v129 |
c tt: t_v16 t_v275 |
d: t_v56 |
;
The bar | has no fixed meaning. It is probably used as a delimiter. The macro variable is later split in subtrings delimited by |. This is often done using the %scan function and represents a way of list processing.
The colon indicates a prefix. bb: - all variables starting with bb. Many SAS PROC and the datastep can process variable lists this way.
You can put anything in macro variables, and what counts is what you do with it next. Now as a convention, the |
symbol is conveniently used as a field/value separator, while the colon has no clear "conventional" use that I know of. Depending on the context, it could mean that values on its left (columns/variables) are to be associated to values to its right (other columns maybe). But you'd really need to look further down the code and look for loops using &v_lst
, probably along with scan()
or %scan()
functions.