pass iterator as value to macro function [duplicate]
up vote
0
down vote
favorite
This question already has an answer here:
Dynamically call macro from sas data step
3 answers
I would like to pass do
iterator as value - see example below
%macro print_to_log(val=);
%put &val;
%mend print_to_log;
data _null_;
do i = -15 to 0;
%print_to_log(val=i);
end;
run;
It only prints the character i
to the log.
sas
marked as duplicate by Reeza, Community♦ Nov 20 at 18:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
Dynamically call macro from sas data step
3 answers
I would like to pass do
iterator as value - see example below
%macro print_to_log(val=);
%put &val;
%mend print_to_log;
data _null_;
do i = -15 to 0;
%print_to_log(val=i);
end;
run;
It only prints the character i
to the log.
sas
marked as duplicate by Reeza, Community♦ Nov 20 at 18:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
Dynamically call macro from sas data step
3 answers
I would like to pass do
iterator as value - see example below
%macro print_to_log(val=);
%put &val;
%mend print_to_log;
data _null_;
do i = -15 to 0;
%print_to_log(val=i);
end;
run;
It only prints the character i
to the log.
sas
This question already has an answer here:
Dynamically call macro from sas data step
3 answers
I would like to pass do
iterator as value - see example below
%macro print_to_log(val=);
%put &val;
%mend print_to_log;
data _null_;
do i = -15 to 0;
%print_to_log(val=i);
end;
run;
It only prints the character i
to the log.
This question already has an answer here:
Dynamically call macro from sas data step
3 answers
sas
sas
asked Nov 20 at 17:05
CPak
9,3991723
9,3991723
marked as duplicate by Reeza, Community♦ Nov 20 at 18:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Reeza, Community♦ Nov 20 at 18:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17
add a comment |
1
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17
1
1
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Will this work for you, if you use another macro instead of null ds as below?
%macro print_to_log(val);
%put &val;
%mend print_to_log;
%macro loop;
%do i = -15 %to 0;
%print_to_log(&i);
%end;
%mend loop;
%loop;
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Will this work for you, if you use another macro instead of null ds as below?
%macro print_to_log(val);
%put &val;
%mend print_to_log;
%macro loop;
%do i = -15 %to 0;
%print_to_log(&i);
%end;
%mend loop;
%loop;
add a comment |
up vote
0
down vote
Will this work for you, if you use another macro instead of null ds as below?
%macro print_to_log(val);
%put &val;
%mend print_to_log;
%macro loop;
%do i = -15 %to 0;
%print_to_log(&i);
%end;
%mend loop;
%loop;
add a comment |
up vote
0
down vote
up vote
0
down vote
Will this work for you, if you use another macro instead of null ds as below?
%macro print_to_log(val);
%put &val;
%mend print_to_log;
%macro loop;
%do i = -15 %to 0;
%print_to_log(&i);
%end;
%mend loop;
%loop;
Will this work for you, if you use another macro instead of null ds as below?
%macro print_to_log(val);
%put &val;
%mend print_to_log;
%macro loop;
%do i = -15 %to 0;
%print_to_log(&i);
%end;
%mend loop;
%loop;
answered Nov 20 at 18:02
Rhythm
2106
2106
add a comment |
add a comment |
1
Use CALL EXECUTE to call the macro or DOSUBL instead. There's an example in the documentation.
– Reeza
Nov 20 at 17:09
Thank you @Reeza - definitely a duplicate in concept
– CPak
Nov 20 at 17:17