DATA Step, Macro, Functions and more

Expected numeric precision behaviour or unexpected issue?

Reply
Frequent Contributor
Frequent Contributor
Posts: 98

Expected numeric precision behaviour or unexpected issue?

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.

 

 

Super User
Posts: 7,768

Re: Expected numeric precision behaviour or unexpected issue?

My first guess would be that you have an unbalanced quote somewhere else in your code.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Super User
Posts: 7,942

Re: Expected numeric precision behaviour or unexpected issue?

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?

Frequent Contributor
Frequent Contributor
Posts: 98

Re: Expected numeric precision behaviour or unexpected issue?

ok, I will try .

Frequent Contributor
Frequent Contributor
Posts: 98

Re: Expected numeric precision behaviour or unexpected issue?

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.

Super User
Super User
Posts: 7,942

Re: Expected numeric precision behaviour or unexpected issue?

Thats not to do with my code.  You have/had unbalanced quotes at some point.  Start a new fresh session.

Frequent Contributor
Frequent Contributor
Posts: 98

Re: Expected numeric precision behaviour or unexpected issue?

before it works, not sure what went wrong , dose not working any more....

 

I need %macro for this....

 

 

 

Frequent Contributor
Frequent Contributor
Posts: 98

Re: Expected numeric precision behaviour or unexpected issue?

agree, I am starting a new sestion.

 

Frequent Contributor
Frequent Contributor
Posts: 98

Re: Expected numeric precision behaviour or unexpected issue?

after start new session, it works.

 

Thank you

Ask a Question
Discussion stats
  • 8 replies
  • 97 views
  • 0 likes
  • 3 in conversation