<?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: Syntax Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81491#M17532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the problem is comming from the places you have the input table name in the AS clause such as:&lt;/P&gt;&lt;P&gt;t1.AELine as t1.AELineA&lt;/P&gt;&lt;P&gt;try removing the t1. from these:&lt;/P&gt;&lt;P&gt;t1.AELine as AELineA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 17:52:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-07-16T17:52:42Z</dc:date>
    <item>
      <title>Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81490#M17531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Can anyone take a look at my proc sql syntax error. I am not able to spot the error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PCODE2 resolves to AE&lt;BR /&gt;MPRINT(_BUILD_METRICS):&amp;nbsp;&amp;nbsp; CREATE TABLE WORK.AE_LINE_DELTA_Voc&amp;nbsp; AS SELECT &lt;BR /&gt;t1.AELine as t1.AELineA, t1._AE_CustomHrBin as _AE_CustomHrBinA, t1.AEUnit as AEUnitA, &lt;BR /&gt;t1._TYPE_, t1._FREQ_, t1.AE_Voc_Mean as AE_Voc_Mean_A , t2.AE_Voc_Mean AS AE_Voc_Mean_B , &lt;BR /&gt;(t1.AE_Voc_Mean - t2.AE_Voc_Mean)&amp;nbsp; AS AE_Voc_Delta, t1.AE_Voc_stddev as &lt;BR /&gt;t1.AE_Voc_stddev_A, t1.AE_Voc_var as t1.AE_Voc_var_A, t1.AE_Voc_sum as t1.AE_Voc_sum_A, &lt;BR /&gt;t1.AE_Voc_N as t1.AE_Voc_N_A, t1.AE_Voc_nmiss as t1.AE_Voc_nmiss_A, t2.AELine AS AELineB, &lt;BR /&gt;t2._AE_CustomHrBin AS _AE_CustomHrBinB, t2.AEUnit AS AEUnitB, t2._TYPE_ AS _TYPE_1, t2._FREQ_ AS _FREQ_1, &lt;BR /&gt;t2.AE_Voc_stddev AS total_eff_StdDev_B, t2.AE_Voc_var AS total_eff_Var_B, t2.AE_Voc_sum AS total_eff_Sum_B, &lt;BR /&gt;t2.AE_Voc_N AS total_eff_N_B, t2.AE_Voc_nmiss AS total_eff_NMiss_B FROM WORK.AE_LINE_DELTA_Voc t1, &lt;BR /&gt;WORK.AE_LINE_DELTA_Voc t2 WHERE (t1.AEUnit = t2.AEUnit AND t1._AE_CustomHrBin = t2._AE_CustomHrBin) &lt;BR /&gt;AND (t1.AELine CONTAINS 'A' AND t2.AELine CONTAINS 'B');&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ',', AS, FORMAT, FROM, INFORMAT, INTO, LABEL, LEN, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LENGTH, TRANSCODE. &lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;MPRINT(_BUILD_METRICS):&amp;nbsp;&amp;nbsp; QUIT;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;saspert&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81490#M17531</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2013-07-16T17:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81491#M17532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the problem is comming from the places you have the input table name in the AS clause such as:&lt;/P&gt;&lt;P&gt;t1.AELine as t1.AELineA&lt;/P&gt;&lt;P&gt;try removing the t1. from these:&lt;/P&gt;&lt;P&gt;t1.AELine as AELineA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81491#M17532</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-07-16T17:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81492#M17533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if it is required, but I think you need the 'as' in these statements...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM WORK.AE_LINE_DELTA_Voc as t1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WORK.AE_LINE_DELTA_Voc as t2 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81492#M17533</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2013-07-16T17:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81493#M17534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT t1.AELine as t1.AELineA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;never having tried it I can only guess that it causes an error when an alias appears after AS&amp;nbsp; like in the first column of the SELECT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81493#M17534</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-07-16T17:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81494#M17535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks. I think it fixed the error. The pitfalls of copying and pasting and not thinking.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 18:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81494#M17535</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2013-07-16T18:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81495#M17536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with BallardW, that certainly is a problem. The MACRO processor sure makes that code hard to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 18:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81495#M17536</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-07-16T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81496#M17537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doen't even need to be an alias, the processor doesn't appear to like any table reference following AS for variable selection. At least not in the test I did using 9.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 21:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81496#M17537</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-07-16T21:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81497#M17538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with BallardW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE WORK.AE_LINE_DELTA_VOC&amp;nbsp; AS &lt;/P&gt;&lt;P&gt;SELECT CL1.SEX AS SEX1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CL2.SEX AS SEX2&lt;/P&gt;&lt;P&gt;FROM SASHELP.CLASS CL1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASHELP.CLASS CL2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE WORK.AE_LINE_DELTA_VOC&amp;nbsp; AS &lt;/P&gt;&lt;P&gt;SELECT CL1.SEX AS CL1.SEX1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CL2.SEX AS CL2.SEX2&lt;/P&gt;&lt;P&gt;FROM SASHELP.CLASS CL1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASHELP.CLASS CL2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ',', AS, FORMAT, &lt;/P&gt;&lt;P&gt;FROM, INFORMAT, INTO, LABEL, LEN, LENGTH, TRANSCODE.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 06:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error/m-p/81497#M17538</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-07-17T06:03:22Z</dc:date>
    </item>
  </channel>
</rss>

