03-05-2018 04:11 AM - last edited on 03-05-2018 07:59 AM by Tom
Could please help to mask the variables Cavg(ss) and AUC_%Extrap_obs in the text of macros:
... %if &ppfile=pksc %then %do; Cavg(ss) AUC_%Extrap_obs; %end;
03-05-2018 04:25 AM
Seriously though, if your having to use these, do you not think there are better ways of working, because there are, many options. Macro is not a replacement for base SAS, it just makes long winded unmaintainable code which someone has to come in and delete at some point.
03-05-2018 08:02 AM
Can you explain what this snippet of code is trying to do?
Cavg(ss) and AUC_%Extrap_obs are not valid variable names. If those a really your variable names you can reference them with name literals.
If that is just text then look at macro quoting functions like %STR().
03-05-2018 02:02 PM
Yes, they are not valid variables names in SAS but they are the names of variables in xlsx file that is read as sas library.
So just use name literals to refer to the variable names. Make sure to use single quotes and not double quotes when constructing the name literals so that the macro processor does not try to act on the macro triggers, & or %, that might occur in the variable names.
03-06-2018 01:44 AM - edited 03-06-2018 01:57 AM
I have found this link: it seems that 'do' cycle is needed as well as double ampersant - https://support.sas.com/resources/papers/proceedings13/005-2013.pdf . In my understanding it is not ordinary task to force SAS to stop re-scan in searching of macrotriggers. Especially if a program have several ones/levels. I have no final decision yet.