Hi everyone, thanks for your prompt replies. Here is the dataset work.test3: Here is some output from the log MLOGIC(SPLIT): Beginning execution.
SYMBOLGEN: Macro variable NUM_OBS resolves to 5
MLOGIC(SPLIT): %DO loop beginning; index variable I; start value is 1; stop value is 5; by value is 1.
MPRINT(SPLIT): data _null_;
SYMBOLGEN: Macro variable I resolves to 1
SYMBOLGEN: Macro variable I resolves to 1
SYMBOLGEN: Macro variable INPUT_VAR2 resolves to group
MPRINT(SPLIT): set work.test3(obs=1 firstobs=1 keep = group);
SYMBOLGEN: Macro variable INPUT_VAR2 resolves to group
MPRINT(SPLIT): call symputx('MyVar', group);
MPRINT(SPLIT): stop;
MPRINT(SPLIT): run;
MLOGIC(SPLIT): %PUT &MyVar.
SYMBOLGEN: Macro variable MYVAR resolves to a:(0to30K]
a:(0to30K]
SYMBOLGEN: Macro variable MYVAR resolves to a:(0to30K]
ERROR: Expected close parenthesis after macro function invocation not found.
MLOGIC(SPLIT): %IF condition %sysfunc(anyalpha(&MyVar.)) ge 1 is TRUE
MLOGIC(SPLIT): %LET (variable name is MYVAR2)
SYMBOLGEN: Macro variable MYVAR resolves to a:(0to30K]
MLOGIC(SPLIT): %PUT &MyVar2.
SYMBOLGEN: Macro variable MYVAR2 resolves to "a:(0to30K]"
"a:(0to30K]"
SYMBOLGEN: Macro variable INPUT_VAR2 resolves to group
SYMBOLGEN: Macro variable I resolves to 1
MPRINT(SPLIT): data work.group1;
MPRINT(SPLIT): set work.test;
SYMBOLGEN: Macro variable INPUT_VAR2 resolves to group
SYMBOLGEN: Macro variable MYVAR2 resolves to "a:(0to30K]"
MPRINT(SPLIT): where group = "a:(0to30K]";
MPRINT(SPLIT): run; Something to mention, is that work.test3 isn't guaranteed to be those variables. Sometimes it would be different categories such as years: 2012, 2013, ..., 2020. So when the categories are numbers, the where= data statement should be where group = 2020 while with the categories in the image it should be where group = "a:(0to30K]". So there is a difference in quotation marks.
... View more