<?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: intck on teradata tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586499#M167426</link>
    <description>&lt;P&gt;I haven't used Teradata before, or have access to it. But there are two ways to work with data in a database. See the following post:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Implicit-vs-Explicit-SQL-Pass-through-SQL-Query-in-SAS/td-p/261905" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Implicit-vs-Explicit-SQL-Pass-through-SQL-Query-in-SAS/td-p/261905&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are using what's called Explicit-SQL-Pass-Through. That is, you are using Teradata SQL syntax in SAS and passing it directly to the database. That works well if you are familiar with native Teradata SQL and know those functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you seem to be using SAS functions, not all are known to Teradata since Teradata doesn't have those functions (or a different name for them). Since you are using SAS functions, you might want to try &lt;STRONG&gt;Implicit-SQL-Pass-Through&lt;/STRONG&gt;. Here you are using SAS PROC SQL (and SAS functions) in your query, and SAS is translating your SAS SQL query to native Teradata SQL. The engine does the translating work for you. All you need to do is connect to the database using the LIBNAME statement and the options for your database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Few specifics to SAS PROC SQL in your example:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- The TODAY() function finds today's date in SAS. From the looks of it that won't work in Teradata since Teradata uses &lt;STRONG&gt;current_date&lt;/STRONG&gt;. See the Teradata doc for &lt;A href="https://docs.teradata.com/reader/kmuOwjp1zEYg98JsB8fu_A/W2ZJsPFeR7EFlyBUnQWrEwhttps://docs.teradata.com/reader/kmuOwjp1zEYg98JsB8fu_A/W2ZJsPFeR7EFlyBUnQWrEw" target="_self"&gt;current_date&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- From a quick search Teradata does not have the INTCK function. You would have to use Teradata's method for calculating days between two dates. See the Teradata doc for&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://docs.teradata.com/reader/1DcoER_KpnGTfgPinRAFUw/WdO2taOuHi5IaUk0dEsJTg" target="_self"&gt;Calculating the Difference in Days Between DATE Values&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You could rewrite your query using some Teradata functions (linked above). But if you are more comfortable with PROC SQL I'd probably try and use implicit pass through with the LIBNAME statement and let SAS do the work. See some documentation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p0gy4y5g1dy090n18jq1riw5g8d5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;LIBNAME Statement for the Teradata Engine&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/kb/41/629.html" target="_self"&gt;Sample of LIBNAME and PROC SQL Pass-Through code to connect to Teradata database using SAS/ACCESS® Interface to Teradata&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/teradata.pdf" target="_self"&gt;SAS/ACCESS Interface to Teradata paper&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&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;</description>
    <pubDate>Thu, 05 Sep 2019 18:08:41 GMT</pubDate>
    <dc:creator>Panagiotis</dc:creator>
    <dc:date>2019-09-05T18:08:41Z</dc:date>
    <item>
      <title>intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586481#M167423</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to execute intck statement on a teradata table:&lt;/P&gt;&lt;P&gt;case when intck('day',&lt;CODE class=" language-sas"&gt;close_date&lt;/CODE&gt;,today() ) le 80 then 'Y' else 'N' end as &lt;CODE class=" language-sas"&gt;Closed&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;but it gives me the error:&amp;nbsp;ERROR: Teradata prepare: Syntax error: expected something between '(' and the string 'day'.&lt;/P&gt;&lt;P&gt;I then found that intck is not supported on teradata.&lt;/P&gt;&lt;P&gt;Today() gives a num type, and &lt;CODE class=" language-sas"&gt;close_date&lt;/CODE&gt; variable is num type with date9. format.&lt;/P&gt;&lt;P&gt;so when I try to run this:&amp;nbsp;&lt;CODE class=" language-sas"&gt;case when ('today()' - 'close_date')le 80 then 'Y' else 'N' end as Closed, it obviously gives me this error:&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;ERROR: Teradata prepare: A character string failed conversion to a numeric value.&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;which is understandable and I know I need to convert close_date into num too. But I'm not sure syntax wise how to do that conversion on a teradata table and then use it to assign the value to the 'Closed' flag.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;  
		connect to teradata (user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=teradata);
		drop table   uwork.pop;
	create table uwork.pop (FASTLOAD=YES) as select * from connection to teradata
(	select top 10 
a.accno,  
b.close_date
/*,case when intck('day',b.close_date,today() ) le 80 then 'Y' else 'N' end as Closed*/
,case when ('today()' - 'b.close_date')le 80 then 'Y' else 'N' end as Closed

from table1 a left join table2 b on a.accno=b.accno
);
DISCONNECT FROM TERADATA;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 17:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586481#M167423</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-05T17:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586499#M167426</link>
      <description>&lt;P&gt;I haven't used Teradata before, or have access to it. But there are two ways to work with data in a database. See the following post:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Implicit-vs-Explicit-SQL-Pass-through-SQL-Query-in-SAS/td-p/261905" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Implicit-vs-Explicit-SQL-Pass-through-SQL-Query-in-SAS/td-p/261905&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are using what's called Explicit-SQL-Pass-Through. That is, you are using Teradata SQL syntax in SAS and passing it directly to the database. That works well if you are familiar with native Teradata SQL and know those functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you seem to be using SAS functions, not all are known to Teradata since Teradata doesn't have those functions (or a different name for them). Since you are using SAS functions, you might want to try &lt;STRONG&gt;Implicit-SQL-Pass-Through&lt;/STRONG&gt;. Here you are using SAS PROC SQL (and SAS functions) in your query, and SAS is translating your SAS SQL query to native Teradata SQL. The engine does the translating work for you. All you need to do is connect to the database using the LIBNAME statement and the options for your database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Few specifics to SAS PROC SQL in your example:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- The TODAY() function finds today's date in SAS. From the looks of it that won't work in Teradata since Teradata uses &lt;STRONG&gt;current_date&lt;/STRONG&gt;. See the Teradata doc for &lt;A href="https://docs.teradata.com/reader/kmuOwjp1zEYg98JsB8fu_A/W2ZJsPFeR7EFlyBUnQWrEwhttps://docs.teradata.com/reader/kmuOwjp1zEYg98JsB8fu_A/W2ZJsPFeR7EFlyBUnQWrEw" target="_self"&gt;current_date&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- From a quick search Teradata does not have the INTCK function. You would have to use Teradata's method for calculating days between two dates. See the Teradata doc for&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://docs.teradata.com/reader/1DcoER_KpnGTfgPinRAFUw/WdO2taOuHi5IaUk0dEsJTg" target="_self"&gt;Calculating the Difference in Days Between DATE Values&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You could rewrite your query using some Teradata functions (linked above). But if you are more comfortable with PROC SQL I'd probably try and use implicit pass through with the LIBNAME statement and let SAS do the work. See some documentation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p0gy4y5g1dy090n18jq1riw5g8d5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;LIBNAME Statement for the Teradata Engine&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/kb/41/629.html" target="_self"&gt;Sample of LIBNAME and PROC SQL Pass-Through code to connect to Teradata database using SAS/ACCESS® Interface to Teradata&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/teradata.pdf" target="_self"&gt;SAS/ACCESS Interface to Teradata paper&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&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;</description>
      <pubDate>Thu, 05 Sep 2019 18:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586499#M167426</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2019-09-05T18:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586509#M167428</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;1. Looks as though you're using the explicit pass-thru access to TD, so you're limited to the TD=specific SQL syntax which, obviously doesn't support SAS functions like INTCK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If you accessed TD via a LIBNAME engine, INTCK would work, as the function would be invoked on the SAS' side after having the TD date translated into the SAS date value. In this case, though, you'd lose the TOP functionality, which is specific to TD and not supported by SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Which is why you're likely better off staying with the pass-thru and using TD-specific functions to find the difference in days between the current date and close date. IIRC, the syntax is as simple as (you'll need to research/try to verify):&lt;/P&gt;
&lt;PRE&gt;CURRENT_DATE - B.CLOSE_DATE&lt;/PRE&gt;
&lt;P&gt;4.&amp;nbsp; Since you're creating a SAS table as a result of the query, I don't think that the FASTLOAD option is relevant.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 18:26:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586509#M167428</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-05T18:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586516#M167429</link>
      <description>Thank you for your response, I added the following libname:&lt;BR /&gt;libname uwork teradata user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=ansi database=user_work;&lt;BR /&gt;&lt;BR /&gt;I can let go of the top functionality if that would help make intk function work.&lt;BR /&gt;&lt;BR /&gt;What change would you recommend to this code:&lt;BR /&gt;libname uwork teradata user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=ansi database=user_work;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to teradata (user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=teradata);&lt;BR /&gt;drop table uwork.pop;&lt;BR /&gt;create table uwork.pop (FASTLOAD=YES) as select * from connection to teradata&lt;BR /&gt;( select&lt;BR /&gt;a.accno,&lt;BR /&gt;b.close_date&lt;BR /&gt;,case when intck('day',b.close_date,today() ) le 80 then 'Y' else 'N' end as Closed&lt;BR /&gt;/*,case when ('today()' - 'b.close_date')le 80 then 'Y' else 'N' end as Closed*/&lt;BR /&gt;&lt;BR /&gt;from table1 a left join table2 b on a.accno=b.accno&lt;BR /&gt;);&lt;BR /&gt;DISCONNECT FROM TERADATA;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;when I run this at the moment, I get this error:&lt;BR /&gt;ERROR: Teradata prepare: Syntax error: expected something between '(' and the string 'day'.&lt;BR /&gt;&lt;BR /&gt;I even tried doing: case when intck('day',close_date,current_date), I still get the same error.&lt;BR /&gt;&lt;BR /&gt;Appreciate your help!</description>
      <pubDate>Thu, 05 Sep 2019 18:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586516#M167429</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-05T18:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586530#M167430</link>
      <description>&lt;P&gt;Looks like you are combining the two. I'll mock some code up that you can test. I don't have access to teradata so test my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Explicit Pass Through (Using native Teradata SQL). See&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;response about functionality.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything here in the parentheses is native to Teradata. That is i'm sending this Teradata SQL directly to the database. I cannot use SAS functionality in the parentheses. So i'm not using INTCK or TODAY(). Instead i'm using Teradata's CURRENT_DATE and just subtracting the dates to get the total number of days. You can see the Teradata documentation I posted above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect to teradata (user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=teradata);
drop table uwork.pop;
create table uwork.pop (FASTLOAD=YES) as 
select * from connection to teradata
   (select a.accno,
           b.close_date,
           case 
              when CURRENT_DATE - B.CLOSE_DATE le 80 then 'Y'
              else 'N' 
           end as Closed
       from table1 a left join table2 b 
       on a.accno=b.accno);
DISCONNECT FROM TERADATA;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Implicit Pass Through (Using native Teradata SQL).&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here I want SAS to convert PROC SQL to native Teradata SQL. This allows me to use SAS functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the LIBNAME statement is pointing to the Teradata database, I don't need the CONNECT TO statement in PROC SQL anymore because i'm already connecting to the database using the LIBNAME statement. Thus, I can use the uwork library like a typical SAS library, but it's referencing tables in the database.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex) uwork.table1, uwork.table2, etc. These will be your Teradata tables as long as the options you set are correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a quick check after you run the LIBNAME statement take a look at your libraries on the navigation pane and make sure you see UWORK. Expand and you should see tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now use PROC SQL and the SAS functions you want. Just reference the tables using uwork. Don't need the CONNECT TO statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname uwork teradata user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=ansi database=user_work;

proc sql;
create table uwork.pop
select a.accno,
       b.close_date,
       case 
         when intck('days',b.close_date,today()) le 80 then 'Y'
           else 'N' 
         end as Closed
       from uwork.table1 a left join uwork.table2 b 
       on a.accno=b.accno;
quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;libname&amp;nbsp;uwork&amp;nbsp;clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 18:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586530#M167430</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2019-09-05T18:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586536#M167431</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;1. First, make sure that you see the table TABLE1 and TABLE2 in UWORK library.&amp;nbsp;If you do, good; if not, your sysadmin may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Are you creating a TD table or SAS table as a result of the query? If it's SAS in the WORK library, then it should be WORK.POP, not UWORK.POP (UWORK points to TD) and you shouldn't use FASTLOAD. Otherwise, keep the references intact.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Assuming that you're querying TD and deliver the result set to the SAS WORK library as data set POP, the query would look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;                                                           
  drop table work.pop ;                                              
  create table work.pop as                                           
  select a.accno                                                     
       , b.close_date                                                
       , case when intck ('day', b.close_date, date()) le 80 then 'Y'
              else 'N'                                               
         end as Closed                                               
  from  uwork.table1 a left join                                     
        uwork.table2 b                                               
  on    a.accno = b.accno                                            
  ;                                                                  
quit ;                                                               
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you're using the libname access now, this is what connects you with TD, so you don't need the connect/disconnect instructions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 19:10:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586536#M167431</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-05T19:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586540#M167433</link>
      <description>I have to pull the result into uwork instead of work since the resulting dataset is huge, so using teradata tables with fastload helps.&lt;BR /&gt;&lt;BR /&gt;The table1 and table 2 referred have their teradata database names called cards, I've associated those with librefs, so now everything is happening through TD.&lt;BR /&gt;&lt;BR /&gt;this is my latest code:&lt;BR /&gt;&lt;BR /&gt;libname uwork teradata user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=ansi database=user_work;&lt;BR /&gt;libname wrktera teradata user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=ansi database=cards;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to teradata (user="%sysget(USER)" password="&amp;amp;dbpass." tdpid=rchtera mode=teradata);&lt;BR /&gt;drop table uwork.pop;&lt;BR /&gt;create table uwork.pop (FASTLOAD=YES) as select * from connection to teradata&lt;BR /&gt;( select top 10&lt;BR /&gt;a.accno,&lt;BR /&gt;b.close_date&lt;BR /&gt;, case when ('current_date' - 'b.close_dt') le 80 then 'Y' else 'N' end as Closed&lt;BR /&gt;&lt;BR /&gt;from cards.table1 a left join cards.table2 b on a.accno=b.accno&lt;BR /&gt;);&lt;BR /&gt;DISCONNECT FROM TERADATA;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;This gives me the error:&lt;BR /&gt;ERROR: Teradata prepare: A character string failed conversion to a numeric value.&lt;BR /&gt;My close_dt is num with date9. Format.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Sep 2019 19:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586540#M167433</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-05T19:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586562#M167439</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Methinks your quoted CURRENT_DATE may be interpreted by TD as a character string rather than a signal to extract the current date and use the value. I'd try to unquote it. The quoted b.close_dt is also a suspect. Have you tried your query in TD SQL Assistant first? That's where I'd normally debug it, and then when it runs error-free, transplant it into proc SQL.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 21:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586562#M167439</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-05T21:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586568#M167442</link>
      <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;,&amp;nbsp;try unquoting the values. Take a look at the Teradata documentation I posted above. It contains some example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 22:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586568#M167442</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2019-09-05T22:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586775#M167506</link>
      <description>this worked, thank you!</description>
      <pubDate>Fri, 06 Sep 2019 14:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586775#M167506</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-06T14:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586776#M167507</link>
      <description>Thank you so much for your help!</description>
      <pubDate>Fri, 06 Sep 2019 14:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586776#M167507</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-06T14:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: intck on teradata tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586786#M167508</link>
      <description>&lt;P&gt;Glad it worked out for you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 14:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-on-teradata-tables/m-p/586786#M167508</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2019-09-06T14:43:23Z</dc:date>
    </item>
  </channel>
</rss>

