title: Syntax error when creating a table in sas
body: <p>I am learning to program in sas and sql and I would like to create a table that contains the value of yesterday (I have stored it in the macrovariable &amp; yesterday), the difference in the amount between the days and the amount of yesterday and the day before yesterday .</p>
  <p>Supposedly the code should be fine, the spaces are put by post in the macrovariables, in fact the error that it returns is syntax, it does not tell me that it does not find such a date or anything like that.</p>
  <p>This is my code:</p>
  <pre><code>PROC SQL;
     CREATE TABLE WORK.QUERY_FOR_TRANSPOSED_DAYBEFORE AS 
           SELECT &amp;yesterday. AS dia_ayer, 
            abs((t1.&quot;    &amp;yesterday.&quot;n - t1.&quot;    &amp;before_yesterday.&quot;n) / t1.&quot;    &amp;before_yesterday.&quot;n) end AS Diferencia_dias, 
            t1.&quot;    &amp;before_yesterday.&quot;n, 
            t1.&quot;    &amp;yesterday.&quot;n
        FROM WORK.Transposed_daybefore t1;
  QUIT;
  </code></pre>
  <p>I get this syntax error right after &amp; before_yesterday. &quot;N) end as Difference_days, just after) and before &quot;end&quot;</p>
  <pre><code>ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;, *, **, +, ',', -, /, &lt;, &lt;=, &lt;&gt;, =, &gt;, &gt;=, ?, AND, AS, 
                CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=. 
  </code></pre>
  <p>and it returns this error just before the FROM:</p>
  <pre><code>ERROR 22-322: Syntax error, expecting one of the following: un nombre, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING, 
                INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.  
  
  ERROR 76-322: Syntax error, statement will be ignored.
  </code></pre>
  <p>I would be very grateful if you help me find the error, thank you very much in advance.</p>