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.
should this
"Check &KK:&&&inp_&KK.a"
be this
"Check &KK.:&&&inp._&KK.a"
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)
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));
Your code does not show a title statement anywhere that I can see. You really should show the entire definition of the macro code.
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!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.