Search code examples
sassas-macro

colon and vertical bar in SAS


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 |
        ;

Solution

  • 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.