BookmarkSubscribeRSS Feed
deleted_user
Not applicable
can someone tell me why this doesn't print anything? I

%macro test;
%put "hello world";
%mend test;

%test;
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Did you look in your SAS log??? That's where %PUT output goes. Your macro worked for me. SAS Log below. Where did you envision having the "hello world" appear????

cynthia

[pre]
1002 %macro test;
1003 %put "hello world";
1004 %mend test;
1005
1006 %test;
"hello world"

[/pre]
deleted_user
Not applicable
I was expecting it to show up exactly where it worked for you. I restarted sas and it worked. I'm not really sure what I did.


Thanks
Hobbes
Calcite | Level 5
My guess is that you probably executed the code once without closing the %MACRO statement with the %MEND statement. So, every next time you executed the code, SAS compiler was still waiting for the closing %MEND keyword appending the code to the opened macro instead of compiling and executing it.

If that happens again you can just execute the mend statement and then try again the full execution of the macro.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1124 views
  • 0 likes
  • 3 in conversation