BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi gyes.

Please, explain me why it says warning.
theMonth and theYear are parameters.
My Code:
proc print data=table1;
title 'All newly made accounts on' &theMonth/&theYear;
run;

And it says next warning:
The TITLE statement is ambiguous due to valid options or unquoted text.

I have already tried in this way:
proc print data=table1;
title 'All newly made accounts on' !! &theMonth/&theYear;
run;

But it does not recognize !! as concatenation mark.

Also it could be great if instead number of month, I can output name of month. I know that there is special format for it, but I cannot apply it. P.S.: May be this post must be in EG Forum...

Message was edited by: Ihor
3 REPLIES 3
Tim_SAS
Barite | Level 11
SAS will resolve macro variables in double-quoted strings. Try this:

[pre]%let theMonth = June;
%let theYear = 2007;
title "All newly made accounts on &theMonth/&theYear";[/pre]
deleted_user
Not applicable
Thanks. It really works.

Also it could be great if instead number of month, I can output name of month. I know that there is special format for it, but I cannot apply it.
deleted_user
Not applicable
I'm not sure what you are trying to do here. You have created a macro symbol that contains the month name, and the title will reflect that name, not the month number.

If you are trying to create the month name and year automatically from the system date, then I have to tell you not to. When you report June's performance at the end of the month, it is likely to be July, and the report will be mistitled.

I presume you have some record selection process to identify the current transactions, and you should tie the record selection to the title in a single common step. If you provide that code to the forum, I can look at refining it.

Kind regards

David

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1276 views
  • 0 likes
  • 2 in conversation