Call it like this:
%unquote(%ild_out)
Read this article to learn why:
https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/bt185.pdf
Bart
Hi, Instead of using %bquote, can use %nrstr to handle the special characters and ensure the macro variables are correctly interpreted.
%macro ild_out;
%do i=2 %to &max_ild.;
%nrstr(
define e%eval(&i.-1)_prog_yn / "Did event%eval(&i.-1) progress to a higher grade per Investigator (Y/N)" style(column)=[cellwidth=0.8in] display;
define e%eval(&i.-1)_prog_date / "If yes, date when event%eval(&i.-1) progressed to a higher grade (event&i.)" style(column)=[cellwidth=0.8in] display;
define e&i._grade / "Grade of event&i." style(column)=[cellwidth=0.8in] display;
define e&i._out / "Outcome of event&i." style(column)=[cellwidth=0.8in] display;
define e&i._action / "Dose action of event&i. for DXd ADC" style(column)=[cellwidth=0.8in] display;
)
%end;
%mend ild_out;
Hope this helps
Thanks a lot, himself! It didn't process and reported the message below. All the macro variables are masked in the define blocks.
Call it like this:
%unquote(%ild_out)
Read this article to learn why:
https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/bt185.pdf
Bart
Why do you want to use %BQUOTE()? It does not seem to serve any purpose.
%macro ild_out;
%local next previous style;
%let style=style(column)=[cellwidth=0.8in] display;
%do next=2 %to &max_ild.;
%let previous=%eval(&next-1);
define e&previous._prog_yn / "Did event&previous. progress to a higher grade per Investigator (Y/N)" &style.;
define e&previous._prog_date / "If yes, date when event&previous. progressed to a higher grade (event&i.)" &style.;
define e&next._grade / "Grade of event&next." &style.;
define e&next._out / "Outcome of event&next." &style.;
define e&next._action / "Dose action of event&next. for DXd ADC" &style.;
%end;
%mend ild_out;
Also where does the value for the "magic" macro variable MAX_ILD come from? It is not a parameter that the macro accepts. Nor is it another LOCAL macro variable that macro created.
Thank you so much, Tom! &maxild is the maximum number of events that was defined in other data step. Your solution also works perfectly. I wish I could mark it as the second solution. Much appreciate it.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.