<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: using a macro variable doesn't seem to work in proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538719#M148303</link>
    <description>&lt;P&gt;Did you check what's in the macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's likely the unformatted value so it will work if you remove the quotation marks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table claims.sql_claims_new as

(select *

from CCW.CLM_LN_MED_MV

where PD_DT gt  &amp;amp;most_recent_pd_dt
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or change how you create the macro variable, I recommend the first option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;
set final.claims_paid_thru_date;
call symput('most_recent_pd_dt',put(pd_dt, date9.));
run;

proc sql;
create table claims.sql_claims_new as

(select *

from CCW.CLM_LN_MED_MV

where PD_DT gt "&amp;amp;most_recent_pd_dt"d
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/56331"&gt;@BRKS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a program that I'm writing where I want to pull in data that has been added to the oracle dataset since the last time the program was run so that I can adjust pai&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;d medi&lt;/SPAN&gt;cal claims to their final values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To&amp;nbsp; do this, after the final adjusted claims are processed, I creat a table that contains the max paid date (pd_dt:&amp;nbsp; date format):&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data final.claims_paid_thru_date (keep=pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if _STAT_ = 'MAX';&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;This dataset has one record, with a pd_dt of Feb 23, 2019:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.jpg" style="width: 182px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27505i9043068057B8E75E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pic1.jpg" alt="pic1.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;The next time that I run the full program, I create a macro variable using data _null_ to collect that date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data _null_ ;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set final.claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;call symput('most_recent_pd_dt',pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;Then I use that date to try and extract everything from the source that has a newer paid date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;proc sql;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;create table claims.sql_claims_new as&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;(select *&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;from CCW.CLM_LN_MED_MV&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;where PD_DT gt "&amp;amp;most_recent_pd_dt"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;quit;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;This is the error I get:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;ERROR: Expression using greater than (&amp;gt;) has components that are of different data types.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;I assume that proc sql can't handle the sas macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Is there some way that I can get around this so that the program doesn't need me to enter the date by hand each time?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Thanks so&amp;nbsp; much!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Barb&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Feb 2019 17:12:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-02-26T17:12:10Z</dc:date>
    <item>
      <title>using a macro variable doesn't seem to work in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538714#M148302</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a program that I'm writing where I want to pull in data that has been added to the oracle dataset since the last time the program was run so that I can adjust pai&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;d medi&lt;/SPAN&gt;cal claims to their final values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To&amp;nbsp; do this, after the final adjusted claims are processed, I creat a table that contains the max paid date (pd_dt:&amp;nbsp; date format):&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data final.claims_paid_thru_date (keep=pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if _STAT_ = 'MAX';&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;This dataset has one record, with a pd_dt of Feb 23, 2019:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.jpg" style="width: 182px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27505i9043068057B8E75E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pic1.jpg" alt="pic1.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;The next time that I run the full program, I create a macro variable using data _null_ to collect that date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data _null_ ;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set final.claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;call symput('most_recent_pd_dt',pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;Then I use that date to try and extract everything from the source that has a newer paid date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;proc sql;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;create table claims.sql_claims_new as&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;(select *&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;from CCW.CLM_LN_MED_MV&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;where PD_DT gt "&amp;amp;most_recent_pd_dt"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;quit;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;This is the error I get:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;ERROR: Expression using greater than (&amp;gt;) has components that are of different data types.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;I assume that proc sql can't handle the sas macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Is there some way that I can get around this so that the program doesn't need me to enter the date by hand each time?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Thanks so&amp;nbsp; much!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Barb&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538714#M148302</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2019-02-26T17:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: using a macro variable doesn't seem to work in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538719#M148303</link>
      <description>&lt;P&gt;Did you check what's in the macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's likely the unformatted value so it will work if you remove the quotation marks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table claims.sql_claims_new as

(select *

from CCW.CLM_LN_MED_MV

where PD_DT gt  &amp;amp;most_recent_pd_dt
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or change how you create the macro variable, I recommend the first option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;
set final.claims_paid_thru_date;
call symput('most_recent_pd_dt',put(pd_dt, date9.));
run;

proc sql;
create table claims.sql_claims_new as

(select *

from CCW.CLM_LN_MED_MV

where PD_DT gt "&amp;amp;most_recent_pd_dt"d
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/56331"&gt;@BRKS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a program that I'm writing where I want to pull in data that has been added to the oracle dataset since the last time the program was run so that I can adjust pai&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;d medi&lt;/SPAN&gt;cal claims to their final values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To&amp;nbsp; do this, after the final adjusted claims are processed, I creat a table that contains the max paid date (pd_dt:&amp;nbsp; date format):&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data final.claims_paid_thru_date (keep=pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if _STAT_ = 'MAX';&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;This dataset has one record, with a pd_dt of Feb 23, 2019:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.jpg" style="width: 182px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27505i9043068057B8E75E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pic1.jpg" alt="pic1.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;The next time that I run the full program, I create a macro variable using data _null_ to collect that date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;data _null_ ;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;set final.claims_paid_thru_date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;call symput('most_recent_pd_dt',pd_dt);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;run;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;Then I use that date to try and extract everything from the source that has a newer paid date:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;proc sql;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;create table claims.sql_claims_new as&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;(select *&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;from CCW.CLM_LN_MED_MV&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;where PD_DT gt "&amp;amp;most_recent_pd_dt"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;quit;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;This is the error I get:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;ERROR: Expression using greater than (&amp;gt;) has components that are of different data types.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;I assume that proc sql can't handle the sas macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Is there some way that I can get around this so that the program doesn't need me to enter the date by hand each time?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Thanks so&amp;nbsp; much!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black;"&gt;Barb&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538719#M148303</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-26T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: using a macro variable doesn't seem to work in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538724#M148305</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;
&lt;P&gt;Ugh...&amp;nbsp; I usually use that macro variable as part of a path name, hence the double quotes...&lt;/P&gt;
&lt;P&gt;Sorry for the trouble and thanks!&amp;nbsp; That worked!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-a-macro-variable-doesn-t-seem-to-work-in-proc-sql/m-p/538724#M148305</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2019-02-26T17:19:38Z</dc:date>
    </item>
  </channel>
</rss>

