<?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 Components that are of different data types. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582821#M13880</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for ask again&lt;/P&gt;&lt;P&gt;I had a similar problem that was fixed with this solution in my code( below), however for another table it is not working.&lt;/P&gt;&lt;P&gt;This solution is fine when&amp;nbsp;&lt;/P&gt;&lt;P&gt;month_id is a VARCHAR(3), however I have a new table where month_id is a integer so I would like to write an arithmetic expression to compare two variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code below it show me this message error&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;32 GOPTIONS ACCESSIBLE;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;33 proc sql;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;34 /*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;35 delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input(month_id,best.) &amp;lt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;35 ! (intck('month','01jan1990'd,today())-3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ERROR: INPUT function requires a character argument.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ERROR: Expression using less than (&amp;lt;) has components that are of different data types.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I understand that I need to change however I have tried some options ,and I am just a beginner user&amp;nbsp; so sorry for my question.&lt;/DIV&gt;&lt;DIV&gt;I tried all this and none is right.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please could anybody help me?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input('month_id',best.) &amp;lt; (intck('month','01jan1990'd,today())-3);*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id&amp;lt;"'(&amp;amp;mthid1.-3)'";*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id&amp;lt;(intck('month','01jan1990'd,today())-3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let today=%sysfunc(today());
%let currdt=%sysfunc(datetime());
%let refdate = &amp;amp;YEARMM1.;/*201906;*/
%let month_id = &amp;amp;MONTHID1.;/*'339';*/
data _null_;
mthid1 = intck('month','01jan1990'd,today());
put mthid1=;
mthid3 = mthid1 - 3;
call symputx('mthid1',mthid1);
call symputx('mthid3',mthid3);
run;
%put mthid1=&amp;amp;mthid1;
%put mthid3=&amp;amp;mthid3;
%put &amp;amp;YEARMM1.;


/*******-----------1.Pay Go Priority Moments ---------*********/
proc sql;

delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input(month_id,best.) &amp;lt; (intck('month','01jan1990'd,today())-3);

quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 14:28:27 GMT</pubDate>
    <dc:creator>jorquec</dc:creator>
    <dc:date>2019-08-21T14:28:27Z</dc:date>
    <item>
      <title>Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582821#M13880</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for ask again&lt;/P&gt;&lt;P&gt;I had a similar problem that was fixed with this solution in my code( below), however for another table it is not working.&lt;/P&gt;&lt;P&gt;This solution is fine when&amp;nbsp;&lt;/P&gt;&lt;P&gt;month_id is a VARCHAR(3), however I have a new table where month_id is a integer so I would like to write an arithmetic expression to compare two variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code below it show me this message error&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;32 GOPTIONS ACCESSIBLE;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;33 proc sql;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;34 /*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;35 delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input(month_id,best.) &amp;lt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;35 ! (intck('month','01jan1990'd,today())-3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ERROR: INPUT function requires a character argument.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ERROR: Expression using less than (&amp;lt;) has components that are of different data types.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I understand that I need to change however I have tried some options ,and I am just a beginner user&amp;nbsp; so sorry for my question.&lt;/DIV&gt;&lt;DIV&gt;I tried all this and none is right.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please could anybody help me?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input('month_id',best.) &amp;lt; (intck('month','01jan1990'd,today())-3);*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id&amp;lt;"'(&amp;amp;mthid1.-3)'";*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id&amp;lt;(intck('month','01jan1990'd,today())-3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let today=%sysfunc(today());
%let currdt=%sysfunc(datetime());
%let refdate = &amp;amp;YEARMM1.;/*201906;*/
%let month_id = &amp;amp;MONTHID1.;/*'339';*/
data _null_;
mthid1 = intck('month','01jan1990'd,today());
put mthid1=;
mthid3 = mthid1 - 3;
call symputx('mthid1',mthid1);
call symputx('mthid3',mthid3);
run;
%put mthid1=&amp;amp;mthid1;
%put mthid3=&amp;amp;mthid3;
%put &amp;amp;YEARMM1.;


/*******-----------1.Pay Go Priority Moments ---------*********/
proc sql;

delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and input(month_id,best.) &amp;lt; (intck('month','01jan1990'd,today())-3);

quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 14:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582821#M13880</guid>
      <dc:creator>jorquec</dc:creator>
      <dc:date>2019-08-21T14:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582826#M13881</link>
      <description>&lt;P&gt;Just use the numeric column as is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;delete from irm.Consumer_Model_Mart
where internal_CA_model_id =107 and month_id &amp;lt; (intck('month','01jan1990'd,today())-3);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 14:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582826#M13881</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-21T14:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582827#M13882</link>
      <description>&lt;P&gt;It looks most likely that your MONTH_ID variable is numeric. At least at this call&lt;/P&gt;
&lt;PRE&gt;delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 
      and input(month_id,best.) &amp;lt;.

 (intck('month','01jan1990'd,today())-3);.&lt;/PRE&gt;
&lt;P&gt;So INPUT would not be needed.&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 
      and month_id &amp;lt; (intck('month','01jan1990'd,today())-3);
&lt;/PRE&gt;
&lt;P&gt;but without knowing exactly what is intended that is only a guess.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your comment in the code&lt;/P&gt;
&lt;PRE&gt;/*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/.
&lt;/PRE&gt;
&lt;P&gt;One wonders why you aren't using the commented line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, did you have code that worked before adding in the macro elements?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 14:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/582827#M13882</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-21T14:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583316#M13950</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am really struggling with this code, if you could please give an idea how to fix this.&lt;/P&gt;&lt;P&gt;I receive a message error again as below:&lt;/P&gt;&lt;P&gt;33 proc sql;&lt;BR /&gt;34 connect to teradata&lt;BR /&gt;35 (user=&amp;amp;td_usr. password=&amp;amp;td_pass. server = 'edwprod' database = 'insights_consumer');&lt;BR /&gt;36 execute (&lt;BR /&gt;37 /*delete from irm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt; &amp;amp;mthid3.;*/&lt;BR /&gt;38&lt;BR /&gt;39 delete from insights_rm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id&lt;BR /&gt;39 ! &amp;lt;(intck('month','01jan1990'd,today())-5);&lt;BR /&gt;40 ) by teradata;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Teradata execute: Syntax error: expected something between '(' and the string 'month'.&lt;/STRONG&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;41 execute (commit;) by teradata;&lt;BR /&gt;NOTE: Statement not executed due to NOEXEC option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let today=%sysfunc(today());
%let currdt=%sysfunc(datetime());
%let refdate = &amp;amp;YEARMM1.;/*201906;*/
%let month_id = &amp;amp;MONTHID1.;/*'339';*/

data _null_;
mthid1 = intck('month','01jan1990'd,today());
put mthid1=;
mthid3 = mthid1 - 3;
call symputx('mthid1',mthid1);
call symputx('mthid3',mthid3);
run;
%put mthid1=&amp;amp;mthid1;
%put mthid3=&amp;amp;mthid3;
%put &amp;amp;YEARMM1.;
%put &amp;amp;MONTHID1.;
%put &amp;amp;month_id.;

/* delete step*/

proc sql;
connect to teradata
(user=&amp;amp;td_usr. password=&amp;amp;td_pass. server = 'edwprod' database = 'insights_consumer');
execute (

delete from insights_rm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt;(intck('month','01jan1990'd,today())-5);
) by teradata;
execute (commit;) by teradata;
quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Aug 2019 19:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583316#M13950</guid>
      <dc:creator>jorquec</dc:creator>
      <dc:date>2019-08-22T19:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583335#M13957</link>
      <description>&lt;P&gt;In explicit passthrough, you need to use the syntax of the DBMS, in this case Teradata. SAS functions will not work there, you need to use the Teradata equivalent.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 20:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583335#M13957</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-22T20:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583340#M13960</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me see if I understand you mean that I can not use the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;delete from insights_rm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt;(intck('month','01jan1990'd,today())-5);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but I could use this instead , as current_date is a teradata funcion&lt;/P&gt;&lt;PRE&gt;delete from insights_rm.Consumer_Model_Mart where internal_CA_model_id =107 and month_id &amp;lt;( current_date - 150););&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Does it make sense?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 21:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/583340#M13960</guid>
      <dc:creator>jorquec</dc:creator>
      <dc:date>2019-08-22T21:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Components that are of different data types.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/584138#M14124</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answers and sorry answer so later.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this and it was fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
connect to teradata
(user=&amp;amp;td_usr. password=&amp;amp;td_pass. server = 'edwprod' database = 'insights_consumer');
execute (
DELETE FROM Insights_rm.Consumer_Model_Mart
WHERE  internal_CA_model_id =202 AND 
 
 	month_id &amp;lt;=(SEL B.MODEL_RUN_ID_MAX-3  FROM
			(SELECT  Max(month_id) AS MODEL_RUN_ID_MAX
 			FROM  Insights_rm.Consumer_Model_Mart   A
			WHERE A.internal_CA_model_id =202  )B
			);
			) by teradata;
execute (commit;) by teradata;
quit;&lt;/PRE&gt;&lt;P&gt;Kindly regards&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 07:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Components-that-are-of-different-data-types/m-p/584138#M14124</guid>
      <dc:creator>jorquec</dc:creator>
      <dc:date>2019-08-27T07:31:30Z</dc:date>
    </item>
  </channel>
</rss>

