<?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 Proc SQL doesn't keep results if I run multiple queries in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893702#M353054</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I have a SAS project that has multiple programs in single Process Flow.&lt;/P&gt;
&lt;P&gt;One of programs include multiple SQL queries, when every query is in separate Proc SQL, like this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Merge data from Tables */&lt;BR /&gt;Proc SQL;
Create Table A As
Select * 
From TableA;
Quit;

Proc SQL;
Create Table B As
Select * 
From TableB;
Quit;

Proc SQL;
Create Table Merged As
Select  A.*, B.* 
From A
Inner Join B
On A.ID = B.ID;
Quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is that when I run the whole program, the table A is empty and Table B has values.&lt;/P&gt;
&lt;P&gt;But if I run Proc SQL for table A only I do receive table A with values.&lt;/P&gt;
&lt;P&gt;What could be a problem?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 06:32:52 GMT</pubDate>
    <dc:creator>IgorR</dc:creator>
    <dc:date>2023-09-12T06:32:52Z</dc:date>
    <item>
      <title>Proc SQL doesn't keep results if I run multiple queries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893702#M353054</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I have a SAS project that has multiple programs in single Process Flow.&lt;/P&gt;
&lt;P&gt;One of programs include multiple SQL queries, when every query is in separate Proc SQL, like this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Merge data from Tables */&lt;BR /&gt;Proc SQL;
Create Table A As
Select * 
From TableA;
Quit;

Proc SQL;
Create Table B As
Select * 
From TableB;
Quit;

Proc SQL;
Create Table Merged As
Select  A.*, B.* 
From A
Inner Join B
On A.ID = B.ID;
Quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is that when I run the whole program, the table A is empty and Table B has values.&lt;/P&gt;
&lt;P&gt;But if I run Proc SQL for table A only I do receive table A with values.&lt;/P&gt;
&lt;P&gt;What could be a problem?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 06:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893702#M353054</guid>
      <dc:creator>IgorR</dc:creator>
      <dc:date>2023-09-12T06:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL doesn't keep results if I run multiple queries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893707#M353057</link>
      <description>&lt;P&gt;Show us the log with all the code and all messages.&lt;/P&gt;
&lt;P&gt;Show the code where you "run Proc SQL for table A only I do receive table A with values." from the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One suspects that you are doing something that part way through the code you reuse A as a table name incorrectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or are looking at the wrong data set. Your table Merged would be empty if none of the ID values in A match any in B.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 06:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893707#M353057</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-12T06:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL doesn't keep results if I run multiple queries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893711#M353059</link>
      <description>&lt;P&gt;Hardly possible to help without seeing the log posted as text using the insert code button &amp;lt;/&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 07:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-doesn-t-keep-results-if-I-run-multiple-queries/m-p/893711#M353059</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-09-12T07:39:13Z</dc:date>
    </item>
  </channel>
</rss>

