<?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: Why &amp;quot;ERROR 22-322: Syntax error&amp;quot; when running: array alts[13] $12 _temporary_ (’Update in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505582#M135410</link>
    <description>&lt;P&gt;Post code and log into a code box opened using the forum's {I} as below:&lt;/P&gt;
&lt;PRE&gt;73   array alts[13] $12 _temporary_ (&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;’&lt;/FONT&gt;&lt;/STRONG&gt;Update’ ’Notes’ ’Comments’ ’Wall posts’ ’Private messages’
                                     -
                                     22
                                     76
73 ! ’Chat’ ’Groups’ ’Newsfeed’ ’Like’ ’Photos/Videos’ ’Events’ ’Gaming’ ’Fan pages’);
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,
              a datetime constant, a missing value, iterator, (.

ERROR 76-322: Syntax error, statement will be ignored.

74   set sasuser.bibd; /* read design */
ERROR: File SASUSER.BIBD.DATA does not exist.
75   put alts[x1] +(-1) ’, ’ /* print each attr, comma separated */
                        -
                        22
                        200
76   alts[x2] +(-1) ’, ’ alts[x3] +(-1) ’, ’ alts[x4];
                    -                   -
                    22                  22
                    200                 200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, arrayname,
              #, (, +, /, //, ;, @, @@, OVERPRINT, _ALL_, _BLANKPAGE_, _ODS_, _PAGE_.

ERROR 200-322: The symbol is not recognized and will be ignored.

77   run;
&lt;/PRE&gt;
&lt;P&gt;The message window reformats the code. With the above it is easy to see that the error is indicated by the _ character and&amp;nbsp; is coming from the smart quote before Update. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;is correct about the smart quote issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;smart quote   ’
program quote '&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Oct 2018 14:33:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-18T14:33:59Z</dc:date>
    <item>
      <title>Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update’ ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505554#M135388</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I recently started using macros to create designs for my experiments. I successfully created a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Balanced Incomplete Blocked Design (BIBD)&lt;/SPAN&gt;. Now I'm dealing with this code that should display&amp;nbsp;the BIBD using the actual attribute names rather than just numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;array alts[13] $12 _temporary_ (’Update’ ’Notes’ ’Comments’ ’Wall posts’ ’Private messages’ ’Chat’ ’Groups’ ’Newsfeed’ ’Like’ ’Photos/Videos’ ’Events’ ’Gaming’ ’Fan pages’);&lt;BR /&gt;set sasuser.bibd; /* read design */&lt;BR /&gt;put alts[x1] +(-1) ’, ’ /* print each attr, comma separated */&lt;BR /&gt;alts[x2] +(-1) ’, ’ alts[x3] +(-1) ’, ’ alts[x4];&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I got&amp;nbsp;two&amp;nbsp;errors,&amp;nbsp;the log says:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;42 data _null_;&lt;BR /&gt;43 array alts[13] $12 _temporary_ (’Update’ ’Notes’ ’Comments’ ’Wall posts’ ’Private messages’&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;43 ! ’Chat’ ’Groups’ ’Newsfeed’ ’Like’ ’Photos/Videos’ ’Events’ ’Gaming’ ’Fan pages’);&lt;BR /&gt;&lt;STRONG&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a datetime constant, a missing value, iterator, (.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;44 set sasuser.bibd; /* read design */&lt;BR /&gt;45 put alts[x1] +(-1) ’, ’ /* print each attr, comma separated */&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;46 alts[x2] +(-1) ’, ’ alts[x3] +(-1) ’, ’ alts[x4];&lt;BR /&gt;- -&lt;BR /&gt;22 22&lt;BR /&gt;200 200&lt;BR /&gt;&lt;STRONG&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, arrayname, #, (,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+, /, //, ;, @, @@, OVERPRINT, _ALL_, _BLANKPAGE_, _ODS_, _PAGE_.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect that both errors are due to some sort of format/versioning issue but I have not been able to understand where the problem lies. System is SAS 9.4 TS Level 1M5. I do apologise in advance if the question is mundane to the experts, I'm still a beginner. Thank you in advance for any suggestion.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505554#M135388</guid>
      <dc:creator>calmac</dc:creator>
      <dc:date>2018-10-18T13:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505561#M135393</link>
      <description>&lt;PRE&gt;
 ’Private messages’
is over 12 characters.

Try  $ 40 .....

&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505561#M135393</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-10-18T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505563#M135395</link>
      <description>&lt;P&gt;Well, and not sure this matters, when I copy just the code I get funny quote marks:&lt;/P&gt;
&lt;PRE&gt;data _null_;
array alts[13] $12 _temporary_ (’Update’ ’Notes’ ’Comments’ ’Wall posts’ ’Private messages’ ’Chat’ ’Groups’ ’Newsfeed’ ’Like’ ’Photos/Videos’ ’Events’ ’Gaming’ ’Fan pages’);

run;&lt;/PRE&gt;
&lt;P&gt;When I replace those quotes with ', then the code runs fine.&amp;nbsp; I would suggest starting a new session and running again, its possible you have things hanging over from previous runs, especially if it fails later on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This worked for me:&lt;/P&gt;
&lt;PRE&gt;data tmp;
  array alts[13] $12 _temporary_ ('Update' 'Notes' 'Comments' 'Wall posts' 'Private messages' 'Chat' 'Groups' 'Newsfeed' 'Like' 'Photos/Videos' 'Events' 'Gaming' 'Fan pages');
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505563#M135395</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-18T14:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505564#M135396</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;PLEASE&lt;FONT size="2"&gt; post code using the "little running man" button. Your code as posted contains non-ASCII quotes and is therefore completely unusable.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505564#M135396</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T14:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505568#M135400</link>
      <description>&lt;P&gt;As I see it, those non-standard quotes are the reason for your syntax ERROR.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;STRONG HINT:&lt;/STRONG&gt; never use word processors for programming, only suitable &lt;EM&gt;text&lt;/EM&gt; editors like the SAS Enhanced Editor or notepad++.&lt;/P&gt;
&lt;P&gt;This code works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
array alts[13] $12 _temporary_ ('Update' 'Notes' 'Comments' 'Wall posts' 'Private messages' 'Chat' 'Groups' 'Newsfeed' 'Like' 'Photos/Videos' 'Events' 'Gaming' 'Fan pages');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505568#M135400</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T14:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505582#M135410</link>
      <description>&lt;P&gt;Post code and log into a code box opened using the forum's {I} as below:&lt;/P&gt;
&lt;PRE&gt;73   array alts[13] $12 _temporary_ (&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;’&lt;/FONT&gt;&lt;/STRONG&gt;Update’ ’Notes’ ’Comments’ ’Wall posts’ ’Private messages’
                                     -
                                     22
                                     76
73 ! ’Chat’ ’Groups’ ’Newsfeed’ ’Like’ ’Photos/Videos’ ’Events’ ’Gaming’ ’Fan pages’);
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,
              a datetime constant, a missing value, iterator, (.

ERROR 76-322: Syntax error, statement will be ignored.

74   set sasuser.bibd; /* read design */
ERROR: File SASUSER.BIBD.DATA does not exist.
75   put alts[x1] +(-1) ’, ’ /* print each attr, comma separated */
                        -
                        22
                        200
76   alts[x2] +(-1) ’, ’ alts[x3] +(-1) ’, ’ alts[x4];
                    -                   -
                    22                  22
                    200                 200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, arrayname,
              #, (, +, /, //, ;, @, @@, OVERPRINT, _ALL_, _BLANKPAGE_, _ODS_, _PAGE_.

ERROR 200-322: The symbol is not recognized and will be ignored.

77   run;
&lt;/PRE&gt;
&lt;P&gt;The message window reformats the code. With the above it is easy to see that the error is indicated by the _ character and&amp;nbsp; is coming from the smart quote before Update. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;is correct about the smart quote issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;smart quote   ’
program quote '&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 14:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505582#M135410</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-18T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why "ERROR 22-322: Syntax error" when running: array alts[13] $12 _temporary_ (’Update</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505744#M135473</link>
      <description>&lt;P&gt;Thank you RW9, and thank you&amp;nbsp;&lt;SPAN class="login-bold"&gt;KurtBremser for pointing me to the little running man. My bad, I'll use a proper editor. Cheers&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 20:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-quot-ERROR-22-322-Syntax-error-quot-when-running-array-alts/m-p/505744#M135473</guid>
      <dc:creator>calmac</dc:creator>
      <dc:date>2018-10-18T20:12:24Z</dc:date>
    </item>
  </channel>
</rss>

