<?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: Create multiple -volatile tanles in tera and then sas data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958506#M374085</link>
    <description>The connection is dropped at the end of the PROC SQL step.&lt;BR /&gt;Try to issue the LIBNAME statement before the PROC SQL's.&lt;BR /&gt;Another work-around is to extract the data to SAS in the same/last PROC SQL.</description>
    <pubDate>Thu, 06 Feb 2025 07:55:30 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2025-02-06T07:55:30Z</dc:date>
    <item>
      <title>Create multiple -volatile tanles in tera and then sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958501#M374082</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am trying to create multiple volatile tables in tera -volatile1,volatile1,volatile3&lt;/P&gt;
&lt;P&gt;And then I want to create a sas data set from&amp;nbsp;volatile3.&lt;/P&gt;
&lt;P&gt;STEP1 (Create&amp;nbsp; volatile tables in tera -volatile1,volatile1,volatile3 is running successfully with no error)&lt;/P&gt;
&lt;P&gt;STEP2 (Create sas date set from tera&amp;nbsp;volatile3 ) is not working&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: File TDWORK.v3.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Please note that in step1 I didnt run&amp;nbsp; disconnect from teradata statement&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/**STEP1**/
proc sql; 
connect to teradata (server=dwprod schema=DWP_vall authdomain=TeraDataAuth connection=global); 
/* Create volatile table1 */
execute( 
create volatile table v1 as
(
SELECT TOP 100000
            Branch_Cust_Nbr AS customer_ID,
            Branch_Cust_IP,
            first_Branch_Cust_IP AS numerator,
            Team_IP
        FROM VBM374_USED_BRANCH_CUSTOMER
)  
with data primary index (Branch_Cust_IP) 
on commit preserve rows  ) by teradata; 
/* Create volatile table2 */
execute( 
create volatile table v2 as
(
SELECT TOP 100000
            Team_IP,
            Branch_Nbr
        FROM VBM376_INTERNAL_ORGANIZATION
)  
with data primary index (TEAM_IP) 
on commit preserve rows  ) by teradata; 
 /* Create volatile table3 by merging table1 and table2 */
  execute (
CREATE VOLATILE TABLE v3 AS
(SELECT
            a.customer_ID,
            a.Branch_Cust_IP,
            a.numerator,
            b.Team_IP,
            b.Branch_Nbr
        FROM v1 as a
        LEFT JOIN v2 as b
        ON a.Team_IP =b.Team_IP)

with data primary index (Branch_Cust_IP) 
on commit preserve rows  ) by teradata;
/*    disconnect from teradata;*/
quit;

/**STEP2**/
libname tdwork teradata 
AUTHDOMAIN=TeraDataAuth 
mode=teradata  
server=dwprod
schema=DWP_vall
connection=global 
dbmstemp=yes;

proc sql;
create table want as
select *
from tdwork.v3
;
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2025 05:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958501#M374082</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-02-06T05:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple -volatile tanles in tera and then sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958506#M374085</link>
      <description>The connection is dropped at the end of the PROC SQL step.&lt;BR /&gt;Try to issue the LIBNAME statement before the PROC SQL's.&lt;BR /&gt;Another work-around is to extract the data to SAS in the same/last PROC SQL.</description>
      <pubDate>Thu, 06 Feb 2025 07:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958506#M374085</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-02-06T07:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple -volatile tanles in tera and then sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958546#M374103</link>
      <description>Can you please show code ?</description>
      <pubDate>Thu, 06 Feb 2025 14:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958546#M374103</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-02-06T14:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple -volatile tanles in tera and then sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958552#M374109</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;Can you please show code ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have all the code you need, just change the order.&lt;/P&gt;
&lt;P&gt;First make the libref (make sure it is pointing to the right place to find your volatile tables). The teradata system I used 10-15 years ago that meant setting the SCHEMA= option to my Teradata username.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname tdwork teradata 
AUTHDOMAIN=TeraDataAuth 
mode=teradata  
server=dwprod
schema=DWP_vall
connection=global 
dbmstemp=yes
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Second make the volatile tables.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/**STEP1**/
proc sql; 
connect using tdwork as teradata ;
/* Create volatile table1 */
execute by teradata( 
create volatile table v1 as
(
SELECT TOP 100000
            Branch_Cust_Nbr AS customer_ID,
            Branch_Cust_IP,
            first_Branch_Cust_IP AS numerator,
            Team_IP
        FROM VBM374_USED_BRANCH_CUSTOMER
)  
with data primary index (Branch_Cust_IP) 
on commit preserve rows  ); 
/* Create volatile table2 */
execute by teradata ( 
create volatile table v2 as
(
SELECT TOP 100000
            Team_IP,
            Branch_Nbr
        FROM VBM376_INTERNAL_ORGANIZATION
)  
with data primary index (TEAM_IP) 
on commit preserve rows  ); 
 /* Create volatile table3 by merging table1 and table2 */
execute  by teradata (
CREATE VOLATILE TABLE v3 AS
(SELECT
            a.customer_ID,
            a.Branch_Cust_IP,
            a.numerator,
            b.Team_IP,
            b.Branch_Nbr
        FROM v1 as a
        LEFT JOIN v2 as b
        ON a.Team_IP =b.Team_IP)

with data primary index (Branch_Cust_IP) 
on commit preserve rows  ) ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Then copy the dataset.&amp;nbsp; You could use a simple DATA step.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set tdwork.v3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Or you could use an SQL query (if you like having to type too much code).&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select *
from tdwork.v3
;
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 15:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-volatile-tanles-in-tera-and-then-sas-data-set/m-p/958552#M374109</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-06T15:20:40Z</dc:date>
    </item>
  </channel>
</rss>

