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

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
  • 785 views
  • 0 likes
  • 2 in conversation