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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 988 views
  • 0 likes
  • 3 in conversation