%macro createGradRetRowsSummaryLines(stud_type, cohortYearCount, cohortYearCount2, gradOrRen, retOrGrad, firstTime);
if cohort=201510 and DisplayColumn="&cohortYearCount2 Year &gradOrRen of &stud_type" then _2014_15b=&retOrGrad._percent;
%mend;
Why is Enterprise Guide throwing an error when I use &retOrGrad._percent should it read this as variable || _percent and query the variable name that matches the concatenation?
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, INPUT, PUT.
Has the value in the macro variable been macro quoted?
Perhaps that is causing the parser to see that as two tokens.
Try adding %UNQUOTE() function.
_2014_15b=%unquote(&retOrGrad._percent)
Please re-run your code with OPTIONS MPRINT; as the first line of the program.
Show us the full SAS log, not just the error messages. Paste the log into the window that appears when the you click on the {i} icon (do not paste your log directly into your reply)
Has the value in the macro variable been macro quoted?
Perhaps that is causing the parser to see that as two tokens.
Try adding %UNQUOTE() function.
_2014_15b=%unquote(&retOrGrad._percent)
@DavidPhillips2 wrote:
%macro createGradRetRowsSummaryLines(stud_type, cohortYearCount, cohortYearCount2, gradOrRen, retOrGrad, firstTime);
if cohort=201510 and DisplayColumn="&cohortYearCount2 Year &gradOrRen of &stud_type" then _2014_15b=&retOrGrad._percent;
%mend;
Why is Enterprise Guide throwing an error when I use &retOrGrad._percent should it read this as variable || _percent and query the variable name that matches the concatenation?
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, INPUT, PUT.
You don't even show the code used to call the macro. So we don't see what possible values your macro variable might have.
My guess is that something in &retorgrad is not valid in a SAS variable name or the length of the result exceeds 32 characters and is not a valid variable name after the concatenation.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.