BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hello:

 

I have a program below.  However, I got a warning message from the LOG screen.  It stated that "WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text."   Please see the details below.   Could anyone help me where things went wrong?  Thanks.

 

%let i=(&KK + 1);
%let KK=%eval(&i);


proc sql;
	create table INP&KK as
 	select site,ID,ICU,Days,Admit,Date
 	from test
 	where ICU=1 and Admit ne '01JAN8888'd and 
		( Days=. or Admit=. or (Admit lt Date) or (Admit gt "&enddate"d))
	order by site;

	%let inp_&KK.a=%str(ICU = 1 and (Admit ne '01JAN8888'd) and (Days=. or Admit=.) );
	%let inp_&KK.b=%str( or (Admit lt Date) or (Admit gt "&enddate"d));

	ods proclabel "Check &KK:&&&inp_&KK.a";

data INP&KK;
	set INP&KK;
	
	var1="ICU="||trim(left(put(ICU,5.)))
	||','||"Days="||trim(left(put(Days,5.)))
	||','||"Admit="||trim(left(put(Admit,mmddyy10.)))
	||','||"Date="||trim(left(put(Date,mmddyy10.)));
run;
%createINP;

MLOGIC(CREATEINP): Beginning execution.
SYMBOLGEN: Macro variable KK resolves to 11
MPRINT(CREATEINP): proc print data = INP11 noobs label;
MPRINT(CREATEINP): by Site;
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Unable to resolve the macro variable reference &inp_
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: Macro variable INP_11A resolves to ICU = 1 and (Admit ne
'01JAN8888'd) and (Day=. or Admit=.)
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have
been unquoted for printing.
MPRINT(CREATEINP): title2 "Check 11:ICU = 1 and (Admit ne '01JAN8888'd) and
(Day=. or Admit=.) ";
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: Macro variable INP_11B resolves to or (Admit lt Date) or
(Admit gt "30Nov2017"d)
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have
been unquoted for printing.
NOTE: Line generated by the macro variable "INP_11B".
1 " or (Admit lt Date) or (Admit gt "30Jun2007"d)
---------------------------------------------------------
49
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
MPRINT(CREATEINP): title3 " or (Admit lt Date) or (Admit gt
"30Jun2007"d)";
MPRINT(CREATEINP): run;
NOTE: No observations in data set WORK.INP11.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

SYMBOLGEN: Macro variable KK resolves to 11
MPRINT(CREATEINP): proc format CNTLOUT=fmt11;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future
SAS release. Inserting white space between a quoted string and the
succeeding identifier is recommended.

SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Unable to resolve the macro variable reference &inp_
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: Macro variable INP_11A resolves to ICU = 1 and (Admit ne
'01JAN8888'd) and (Day=. or Admit=.)
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have
been unquoted for printing.
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable KK resolves to 11
SYMBOLGEN: Macro variable INP_11B resolves to or (Admit lt Date) or
(Admit gt "30June2007"d)
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have
been unquoted for printing.
NOTE: Line generated by the macro variable "INP_11B".
1 "11:ICU = 1 and (Admit ne '01JAN8888'd) and (Day=. or
-------------------------------------------------------------------------
49
1 ! Admit=.) or (Admit lt Date) or (Admit gt "30Jun2007"d)
MPRINT(CREATEINP): value INP 11="11:ICU = 1 and (Admit ne '01JAN8888'd) and
(Day=. or Admit=.) or (Admit lt Date) or (Admit gt "30Jun2007"d)";
NOTE: Format INP is already on the library WORK.FORMATS.
NOTE: Format INP has been output.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future
SAS release. Inserting white space between a quoted string and the
succeeding identifier is recommended.

MPRINT(CREATEINP): run;
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.13 seconds
cpu time 0.04 seconds

NOTE: The data set WORK.FMT11 has 6 observations and 6 variables.

 

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

should this

"Check &KK:&&&inp_&KK.a"

be this

"Check &KK.:&&&inp._&KK.a"

ybz12003
Rhodochrosite | Level 12

I feel like something wrong in the text inside

 

ICU = 1 and (Admit ne '01JAN8888'd) and (Days=. or Admit=.)

 

or (Admit lt Date) or (Admit gt "&enddate"d)

 

Tom
Super User Tom
Super User

You did not show the code that is generating the TITLE statement.

But from the LOG it looks like you are just putting quotes around the value of one or more macro variables that might themselves already have quotes in them.

 

One easy fix is to use the QUOTE() function.

%let mvar1=Has no quotes;
%let mvar2=Has "some" quotes;
title3 %sysfunc(quote(&mvar1 or &mvar2));
ballardw
Super User

Your code does not show a title statement anywhere that I can see. You really should show the entire definition of the macro code.

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 641 views
  • 0 likes
  • 4 in conversation