<?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: Using &amp;quot;Union all&amp;quot; with Manual Values in Proc SQL Returns Error in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673319#M36574</link>
    <description>&lt;P&gt;Create another data set that contains three rows of data and union that data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many (most) implementations of SQL have extensions that are not standard ANSI SQL. So just because some syntax works in one do not expect all of the "features" to work in another SQL. I suspect that the set operators Union and such are expected to work on Tables in the standard SQL and you have encountered yet another extension that SQL Server supports that other SQLs don't.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 22:14:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-29T22:14:34Z</dc:date>
    <item>
      <title>Using "Union all" with Manual Values in Proc SQL Returns Error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673315#M36573</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the following code to do union a table with some manual values :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
SELECT DISTINCT id, sub_id &lt;BR /&gt;FROM mytable
union all select 'A','A'
union all select 'B','B'
union all select 'C','C' ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I gets an error saying :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, 
              AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH, 
              LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.  

ERROR 76-322: Syntax error, statement will be ignored.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please let me know how I should change the code to perform well, as this same code is easily run in SQL Server. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 21:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673315#M36573</guid>
      <dc:creator>sun538</dc:creator>
      <dc:date>2020-07-29T21:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using "Union all" with Manual Values in Proc SQL Returns Error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673319#M36574</link>
      <description>&lt;P&gt;Create another data set that contains three rows of data and union that data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many (most) implementations of SQL have extensions that are not standard ANSI SQL. So just because some syntax works in one do not expect all of the "features" to work in another SQL. I suspect that the set operators Union and such are expected to work on Tables in the standard SQL and you have encountered yet another extension that SQL Server supports that other SQLs don't.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 22:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673319#M36574</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-29T22:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using "Union all" with Manual Values in Proc SQL Returns Error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673325#M36575</link>
      <description>&lt;P&gt;You cannot just SELECT, you have to have something to select FROM.&lt;/P&gt;
&lt;P&gt;Just make a little dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data template;
  if 0 then set mytable(keep=id sub_id);
  input id sub_id;
cards;
A A
B B
C C
;

proc sql;
SELECT DISTINCT id, sub_id FROM mytable
union all select id, sub_id FROM template
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 22:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-quot-Union-all-quot-with-Manual-Values-in-Proc-SQL-Returns/m-p/673325#M36575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-29T22:36:12Z</dc:date>
    </item>
  </channel>
</rss>

