Hello,
I'm trying to figure out a way to display the contents of a macro function into the sas output window instead of the log window.
this is just a sample, just trying to understand a concept here. I know we can use put and %put for variables and macro variables, but what can we do to display the contents of a macro function stored in a remote unix location in the output window instead of the log file. Thank you for your guidance 🙂
Below is the sample code:
options mautosource sasautos = ('unix path location for macro')
nocenter source2 mlogic symbolgen mprint;
%include 'unix path location for macro/checkk.sas';
data _null_;
title 'macro details:';
put z = %checkk;
title;
run;
Details in macro checkk:
File name is checkk.sas
%macro checkk;
a=1 or b=3
%mend;
It may help if you show something that actually should create some output and what you would expect to appear in the output destination.
Since your "example" output for the data step is basically a bunch of uninitialized variables it doesn't make much sense
And is the macro itself supposed to provide the output???
I don't understand your comment about the P statement of Proc Odstext other than in that context:
If I run:
%macro checkk; a=1 or b=3 %mend; proc odstext; p "%checkk"; run;
The results window shows
a=1 or b=3
It may help if you show something that actually should create some output and what you would expect to appear in the output destination.
Since your "example" output for the data step is basically a bunch of uninitialized variables it doesn't make much sense
And is the macro itself supposed to provide the output???
I don't understand your comment about the P statement of Proc Odstext other than in that context:
If I run:
%macro checkk; a=1 or b=3 %mend; proc odstext; p "%checkk"; run;
The results window shows
a=1 or b=3
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.