<?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: Query working on Tera tables+SAS data sets- Efficient Way to run it in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910931#M359212</link>
    <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Your answer say that&amp;nbsp; need to&amp;nbsp; upload&amp;nbsp; SAS data sets to temporary (Volatile) tables in Teradata&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or export the TeraData result into txt file and import it into sas and then work on SAS&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;As I can see your answer require work in both programs-TeraData +SAS&lt;/P&gt;
&lt;P&gt;My question- Can't it all be done in SAS????&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2024 21:46:14 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-01-08T21:46:14Z</dc:date>
    <item>
      <title>Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910919#M359207</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I will try to ask my question here in another way,&lt;/P&gt;
&lt;P&gt;Let's say that some of the source raw data tables are located in TerData(Tables/Views) and some located in SAS (Data SETS).&lt;/P&gt;
&lt;P&gt;Let's say that I need to run a query that work on the Tera tables and during this process create few volatile tables.&lt;/P&gt;
&lt;P&gt;Then the last&amp;nbsp;volatile tables is merged with SAS data sets and then get the final data set .&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Let's say that in Tera have tables-Tera1,Tera2,Tera3&lt;/P&gt;
&lt;P&gt;Let's say that in SAS have data sets: SAS1,SAS2&lt;/P&gt;
&lt;P&gt;Let's say that I want to create&amp;nbsp;volatile table2- V1,V2&lt;/P&gt;
&lt;P&gt;Let's say that I want to create SAS data set -Final_Data_Set&lt;/P&gt;
&lt;P&gt;Let's say that the query is done by the following steps:&lt;/P&gt;
&lt;P&gt;Step1- Create&amp;nbsp;volatile table&amp;nbsp; V1 from Tera table :Tera1,Tera2&lt;/P&gt;
&lt;P&gt;Step2-Create&amp;nbsp;volatile table&amp;nbsp; V2 from Tera table :Tera1,Tera3 and&amp;nbsp;volatile table&amp;nbsp; V1&lt;/P&gt;
&lt;P&gt;Step3-Create SAS final data set called "Final_Data_Set"&amp;nbsp; &amp;nbsp;From&amp;nbsp;volatile table&amp;nbsp; V1 and SAS1(Data set),SAS2(Data set)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Currently I preform the task by:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Running&amp;nbsp; Step1+Step2 in tera data&amp;nbsp; and then export the result(V2) into txt File&lt;/P&gt;
&lt;P&gt;Import the txt File into SAS&lt;/P&gt;
&lt;P&gt;Run Step3 in SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;My question-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Can&amp;nbsp; show please&amp;nbsp; full code how to perform all in SAS?&lt;/P&gt;
&lt;P&gt;Remember that the desired task is to create SAS DATA SET(Final_Data_Set)&lt;/P&gt;
&lt;P&gt;As you can see I run it now in two platforms-Tera+SAS and I think it is not very convenient&lt;/P&gt;
&lt;P&gt;Maybe there is&amp;nbsp; a better way to do it???&amp;nbsp;&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>Mon, 08 Jan 2024 21:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910919#M359207</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-01-08T21:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910924#M359210</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically you want to keep the processing close to where most of your data resides!&lt;/P&gt;
&lt;P&gt;Depending on the size (Records count, and columns count) of your intermediate query result sets in comparison to your SAS data sets.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Teradata results sets larger than SAS data sets --&amp;gt; Use SAS Bulkload to upload your SAS data sets to temporary (Volatile) tables in Teradata and let Teradata query it.&lt;/LI&gt;
&lt;LI&gt;Teradata results set smaller than SAS data sets --&amp;gt; Download the results sets from Teradata and use native SAS Data/Proc Step(s) to process and manipulate the data.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Generally these are best practices we have been taught to follow.&lt;/P&gt;
&lt;P&gt;Check this 2007 paper for reference: &lt;A title="Super Size It!!! Maximize the Performance of Your ETL Processes" href="https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/108-2007.pdf" target="_blank" rel="noopener"&gt;Super Size It!!! Maximize the Performance of Your ETL Processes&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 21:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910924#M359210</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-01-08T21:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910931#M359212</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Your answer say that&amp;nbsp; need to&amp;nbsp; upload&amp;nbsp; SAS data sets to temporary (Volatile) tables in Teradata&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or export the TeraData result into txt file and import it into sas and then work on SAS&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;As I can see your answer require work in both programs-TeraData +SAS&lt;/P&gt;
&lt;P&gt;My question- Can't it all be done in SAS????&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 21:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910931#M359212</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-01-08T21:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910933#M359213</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think I said this "&lt;SPAN&gt;export the TeraData result into txt file and import it into sas and then work on SAS"!!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In SAS, you can &lt;STRONG&gt;directly&lt;/STRONG&gt; create a SAS data set from the result sets of you Teradata query. This is the native functionality of the SAS/ACCESS Interface to Teradata.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There is no need to export to txt and import from txt!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I guess, we need to clearly&amp;nbsp;understand your definition on "Can't it all be done in SAS????" to make sure we are on the same page&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- You have data/tables stored in Teradata&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- You have data /tables stored as SAS data set (*.sas7bdat) files&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What we have been saying (on this thread and your other thread)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- You can use SAS software to submit queries, but these queries will perform much better if you kept the tables where they and only move the subsets where it made sense.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Say you have &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Teradata table with 10 millions records in it, and &lt;/SPAN&gt;&lt;SPAN&gt;another table with 5 million records --&amp;gt; Joining them would result in 3 million records&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. SAS data set with 1 million records --&amp;gt; Joining it with the 3M result set generates 1.5 million records&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It would make no sense to download these two large tables (10M, 5M) from Teradata into SAS data sets to do the join!!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You are better off&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Uploading the 1M SAS data set to Teradata, Perform the join with the 3M result set&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Download the 1.5M result set into SAS data set&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this clarifies things for you,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ahmed&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 22:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910933#M359213</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-01-08T22:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910936#M359216</link>
      <description>&lt;P&gt;Here is a paper about uploading SAS data set/table into Teradata&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings11/142-2011.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings11/142-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 22:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910936#M359216</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-01-08T22:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910938#M359217</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is another paper has very relevant examples to your processing scenario&lt;/P&gt;
&lt;P&gt;&lt;A title="Data movement issues: Explicit SQL Pass-Through can do the trick" href="https://www.lexjansen.com/sesug/2017/DM-57.pdf" target="_blank" rel="noopener"&gt;Data movement issues: Explicit SQL Pass-Through can do the trick&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 22:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910938#M359217</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-01-08T22:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910970#M359228</link>
      <description>&lt;P&gt;In short, yes.&lt;/P&gt;
&lt;P&gt;If you want to use SQL pass through (most control and Teradata like), be sure to have all processing in one session (PROC SQL step).&lt;/P&gt;
&lt;P&gt;At the point that you want/need to download the data to your SAS session, use a&amp;nbsp; SELECT * FROM CONNECTION TO (TD query) statement (in the same PROC SQL).&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 08:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910970#M359228</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-01-09T08:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910998#M359236</link>
      <description>Is your solution you provided is to run all in sas??</description>
      <pubDate>Tue, 09 Jan 2024 14:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/910998#M359236</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-01-09T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/911003#M359239</link>
      <description>&lt;P&gt;Depends what you mean by "run" in SAS?&lt;/P&gt;
&lt;P&gt;You can control all the execution from SAS, yes. But the part you want to be executed (run?) in Teradata you can do so by using SQL pass through.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 15:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/911003#M359239</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-01-09T15:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query working on Tera tables+SAS data sets- Efficient Way to run it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/911016#M359241</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Is your solution you provided is to run all in sas??&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would definitely run it all &lt;STRONG&gt;WITH&lt;/STRONG&gt; SAS, but not all "in" SAS datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I would still use SAS to send code to Teradata to run.&amp;nbsp; For simple stuff I can let SAS do the conversion into Teradata SQL.&amp;nbsp; For complicated stuff I would use PROC SQL to send my own Teradata SQL to the Teradata server to run.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 15:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Query-working-on-Tera-tables-SAS-data-sets-Efficient-Way-to-run/m-p/911016#M359241</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-09T15:47:43Z</dc:date>
    </item>
  </channel>
</rss>

