I have the SAS code:
%Macro liblobname(lib,lob);
PROC SQL;
CREATE TABLE WORK.CLAIMS_&lob AS
SELECT distinct
t1.LOB,
t1.CLAIM_ID,
t1.MEMBER_ID,
t1.MEMBER_AGE,
t1.SERVICE_FROM_DATE,
t1.SERVICE_CATEGORY,
t1.Diag1,
t1.Diag2,
t1.Diag3,
t1.Diag4,
t1.Diag5,
t1.SERVICE_FROM_DATE,
T1.MEDICARE_INDICATOR
FROM &lib..FACETS_CLAIMS t1
WHERE t1.SERVICE_FROM_DATE >= '1Jun2016:0:0:0'dt
AND t1.SERVICE_FROM_DATE <= '31Jul2017:0:0:0'dt
AND T1.MEDICARE_INDICATOR='N';
QUIT;
%MEND liblobname;
%liblobname (KMHP0100,0100);
coudl not find what is wrong, no error message, but no result ....
could not resolve, please advise. thank you.
log:
_
49
1 ! ;*";*/;quit;run;
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.
My first guess would be that you have an unbalanced quote somewhere else in your code.
Not enough information to make any diagnosis here. The log snippet indicates unbalanced quotes. You could simplfy your code somewhat also to:
%macro liblonname (lib=,lob=); data claims_&lob. (keep=lob--medicare_indicator); set &lib..facets_claims; where '01JUN2017'd <= datepart(service_from_date) <= '31JUL2017'd and medicare_indicator="N"; run; %mend liblobname;
Although that whole code could be dropped in favour of putting all &lobs in one dataset and putting & lob as a column, then using by group processing which is both faster and easier to code. Not entirely sure why the whole macro part is there at all, you create a table called lob but never filter on it?
ok, I will try .
run this.
%macro liblonname (lib=,lob=);
data claims_&lob, (keep=lob--medicare_indicator);
set &lib..facets_claims;
where '01JUN2017'd <= datepart(service_from_date) <= '31JUL2017'd
and medicare_indicator="N";
run;
%mend liblobname;
please see attach log file.
Thats not to do with my code. You have/had unbalanced quotes at some point. Start a new fresh session.
before it works, not sure what went wrong , dose not working any more....
I need %macro for this....
agree, I am starting a new sestion.
after start new session, it works.
Thank you
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.