<?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 Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/291229#M952</link>
    <description>proc sql;&lt;BR /&gt;create table import1 as&lt;BR /&gt;select I,J,ENTRY,avg(Height CMDS CBSDL CBSDS CBSDRNharvest SRNumber SRMass&lt;BR /&gt;FSRYield Groundbiomass TBMass Hindex Dmcontent BCarotene PPD1w PPD2w) as&lt;BR /&gt;avg_Y,AVGH&lt;BR /&gt;from import1&lt;BR /&gt;group by I,J,ENTRY;&lt;BR /&gt;title "Griffing model 1 method 4";&lt;BR /&gt;%DialAnalFixModel(NUM_P=6,method=4,Yvar=Height CMDS CBSDL CBSDS&lt;BR /&gt;CBSDRNharvest SRNumber SRMass FSRYield Groundbiomass TBMass Hindex&lt;BR /&gt;Dmcontent BCarotene PPD1w PPD2w,ENV=2,rep=3,dsn=import1);&lt;BR /&gt;run;&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;results with error:&lt;BR /&gt;&lt;BR /&gt;79 proc sql;&lt;BR /&gt;80 create table import1 as&lt;BR /&gt;81 select I,J,ENTRY,avg(Height CMDS CBSDL CBSDS CBSDRNharvest&lt;BR /&gt;SRNumber SRMass FSRYield Groundbiomass TBMass Hindex Dmcontent&lt;BR /&gt;____&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;81 ! BCarotene PPD1w PPD2w) as avg_Y,AVGH&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;,&lt;BR /&gt;(, ), *, **, +, ',', -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND,&lt;BR /&gt;BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS,&lt;BR /&gt;LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||,&lt;BR /&gt;~, ~=.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;82 from import1&lt;BR /&gt;83 group by I,J,ENTRY;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the&lt;BR /&gt;syntax of statements.&lt;BR /&gt;84 title "Griffing model 1 method 4";&lt;BR /&gt;WARNING: Apparent invocation of macro DIALANALFIXMODEL not resolved.&lt;BR /&gt;85 %DialAnalFixModel(NUM_P=6,method=4,Yvar=Height CMDS CBSDL&lt;BR /&gt;CBSDS CBSDRNharvest SRNumber SRMass FSRYield Groundbiomass&lt;BR /&gt;_&lt;BR /&gt;180&lt;BR /&gt;85 ! TBMass Hindex Dmcontent BCarotene PPD1w&lt;BR /&gt;PPD2w,ENV=2,rep=3,dsn=import1);&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;86 run;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement&lt;BR /&gt;has no effect.&lt;BR /&gt;87 quit&lt;BR /&gt;88&lt;BR /&gt;89 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&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;real time 0.01 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
    <pubDate>Fri, 12 Aug 2016 12:15:46 GMT</pubDate>
    <dc:creator>Athanase</dc:creator>
    <dc:date>2016-08-12T12:15:46Z</dc:date>
    <item>
      <title>Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/290144#M929</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Can any one help me to resolve or fix the following syntax error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, ), *, **, +, ',', -, '.',&lt;/DIV&gt;&lt;DIV class="sasError"&gt;/, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS,&lt;/DIV&gt;&lt;DIV class="sasError"&gt;LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Thank you,&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Aug 2016 11:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/290144#M929</guid>
      <dc:creator>Athanase</dc:creator>
      <dc:date>2016-08-08T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/290208#M930</link>
      <description>&lt;P&gt;Well, it is a syntax error, meaning that the code is erroneous. We cannot help you without the code. Please post the &lt;U&gt;whole&lt;/U&gt;&amp;nbsp;log of the offending step.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 14:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/290208#M930</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-08T14:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/291229#M952</link>
      <description>proc sql;&lt;BR /&gt;create table import1 as&lt;BR /&gt;select I,J,ENTRY,avg(Height CMDS CBSDL CBSDS CBSDRNharvest SRNumber SRMass&lt;BR /&gt;FSRYield Groundbiomass TBMass Hindex Dmcontent BCarotene PPD1w PPD2w) as&lt;BR /&gt;avg_Y,AVGH&lt;BR /&gt;from import1&lt;BR /&gt;group by I,J,ENTRY;&lt;BR /&gt;title "Griffing model 1 method 4";&lt;BR /&gt;%DialAnalFixModel(NUM_P=6,method=4,Yvar=Height CMDS CBSDL CBSDS&lt;BR /&gt;CBSDRNharvest SRNumber SRMass FSRYield Groundbiomass TBMass Hindex&lt;BR /&gt;Dmcontent BCarotene PPD1w PPD2w,ENV=2,rep=3,dsn=import1);&lt;BR /&gt;run;&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;results with error:&lt;BR /&gt;&lt;BR /&gt;79 proc sql;&lt;BR /&gt;80 create table import1 as&lt;BR /&gt;81 select I,J,ENTRY,avg(Height CMDS CBSDL CBSDS CBSDRNharvest&lt;BR /&gt;SRNumber SRMass FSRYield Groundbiomass TBMass Hindex Dmcontent&lt;BR /&gt;____&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;81 ! BCarotene PPD1w PPD2w) as avg_Y,AVGH&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;,&lt;BR /&gt;(, ), *, **, +, ',', -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND,&lt;BR /&gt;BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS,&lt;BR /&gt;LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||,&lt;BR /&gt;~, ~=.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;82 from import1&lt;BR /&gt;83 group by I,J,ENTRY;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the&lt;BR /&gt;syntax of statements.&lt;BR /&gt;84 title "Griffing model 1 method 4";&lt;BR /&gt;WARNING: Apparent invocation of macro DIALANALFIXMODEL not resolved.&lt;BR /&gt;85 %DialAnalFixModel(NUM_P=6,method=4,Yvar=Height CMDS CBSDL&lt;BR /&gt;CBSDS CBSDRNharvest SRNumber SRMass FSRYield Groundbiomass&lt;BR /&gt;_&lt;BR /&gt;180&lt;BR /&gt;85 ! TBMass Hindex Dmcontent BCarotene PPD1w&lt;BR /&gt;PPD2w,ENV=2,rep=3,dsn=import1);&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;86 run;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement&lt;BR /&gt;has no effect.&lt;BR /&gt;87 quit&lt;BR /&gt;88&lt;BR /&gt;89 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&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;real time 0.01 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Fri, 12 Aug 2016 12:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/291229#M952</guid>
      <dc:creator>Athanase</dc:creator>
      <dc:date>2016-08-12T12:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/291232#M953</link>
      <description>&lt;P&gt;So there are two separate errors.&lt;/P&gt;
&lt;P&gt;The first is your use of the SQL AVG summary function. SQL summary functions need SQL expressions as arguments, and in SQL, variables must be separated by colons instead of spaces (as in a data step).&lt;/P&gt;
&lt;P&gt;I also found that avg is only available for vertical use (one column over several records), for horizontal averaging (several columns in one record) you should use the mean() function.&lt;/P&gt;
&lt;P&gt;So it should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;mean(Height,CMDS,CBSDL,CBSDS,CBSDRNharvest,SRNumber,SRMass,FSRYield,Groundbiomass,TBMass,Hindex,Dmcontent,BCarotene,PPD1w,PPD2w)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to make it syntactically correct.&lt;/P&gt;
&lt;P&gt;The second error is the invocation of the macro %DialAnalFixModel, which is obviously not known to SAS at this stage. Make sure that a proper %include for the file where this macro is stored is in your program, or get the macro definition text and copy it into your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 12:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Syntax-error/m-p/291232#M953</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-12T12:30:33Z</dc:date>
    </item>
  </channel>
</rss>

