<?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: ERROR 22-322: Expecting a name. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893344#M352908</link>
    <description>&lt;P&gt;Don't saddle yourself with stupid name literals. Fancy strings belong in labels:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select Customer as customer_name label="Customer Name",
Amount as transaction_amount label="Transaction Amount" format=DOLLAR10.2&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Sep 2023 17:40:39 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-09-08T17:40:39Z</dc:date>
    <item>
      <title>ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893317#M352894</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;68&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;69 proc sql;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;70 select Customer as "Customer Name",&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;_______________&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;71 Amount as "Transaction Amount" format=DOLLAR10.2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;____________________&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;ERROR 22-322: Expecting a name.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;72 from sq.transactionfull&lt;/DIV&gt;&lt;DIV class=""&gt;73 where Amount &amp;gt; 1000 and Service ne 'University'&lt;/DIV&gt;&lt;DIV class=""&gt;74 order by Amount desc;&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/DIV&gt;&lt;DIV class=""&gt;75 title "Large Non-Educational Transactions";&lt;/DIV&gt;&lt;DIV class=""&gt;76 quit;&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/DIV&gt;&lt;DIV class=""&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;memory 225.59k&lt;/DIV&gt;&lt;DIV class=""&gt;OS Memory 19104.00k&lt;/DIV&gt;&lt;DIV class=""&gt;Timestamp 09/08/2023 02:25:41 PM&lt;/DIV&gt;&lt;DIV class=""&gt;Step Count 154 Switch Count 1&lt;/DIV&gt;&lt;DIV class=""&gt;Page Faults 0&lt;/DIV&gt;&lt;DIV class=""&gt;Page Reclaims 17&lt;/DIV&gt;&lt;DIV class=""&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class=""&gt;Voluntary Context Switches 7&lt;/DIV&gt;&lt;DIV class=""&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Input Operations 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Output Operations 16&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;77&lt;/DIV&gt;&lt;DIV class=""&gt;78&lt;/DIV&gt;&lt;DIV class=""&gt;79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;89&lt;/DIV&gt;&lt;PRE class=""&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893317#M352894</guid>
      <dc:creator>xun1</dc:creator>
      <dc:date>2023-09-08T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893318#M352895</link>
      <description>&lt;P&gt;If you are trying to create a name literal variable name then the name must &lt;STRONG&gt;always&lt;/STRONG&gt; have an N following the name. Otherwise SAS cannot tell that you are attempt to create a name. Also the System option VALIDVARNAME=ANY has to be in effect to use such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;select Customer as "Customer Name"&lt;/STRONG&gt;&lt;/FONT&gt;N&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="7" color="#800080"&gt;&lt;STRONG&gt;same for your other variables.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;personally I would recommend assigning a LABEL with that text and not use the name literals. They were mostly added as a way to access variables in external databases that allow spaces and other characters that SAS doesn't use for variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a good idea to post LOG entries in a text box opened on the forum using the &amp;lt;/&amp;gt; icon above the message window to maintain the text formatting and position of things like the diagnostic characters. The main message windows reformat text so that the underscore characters no longer appear under the offending text. In some cases it can be a challenge to tell which bit of a long expression is the offender.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 16:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893318#M352895</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-08T16:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893319#M352896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try placing an "n" after the quoted column name to make it a name literal, e.g.,:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"Customer Name"n&lt;/PRE&gt;
&lt;P&gt;Alternatively, remove the quotes and insert an underscore, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Customer_Name&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the same with all your renamed columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893319#M352896</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-09-08T14:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893320#M352897</link>
      <description>&lt;P&gt;its still error&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893320#M352897</guid>
      <dc:creator>xun1</dc:creator>
      <dc:date>2023-09-08T14:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893324#M352899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please ensure you have applied the fix to all necessary columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are still getting the error, then please post the log showing the code and error messages using the Insert Code icon "&amp;lt;/&amp;gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893324#M352899</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-09-08T14:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893344#M352908</link>
      <description>&lt;P&gt;Don't saddle yourself with stupid name literals. Fancy strings belong in labels:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select Customer as customer_name label="Customer Name",
Amount as transaction_amount label="Transaction Amount" format=DOLLAR10.2&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2023 17:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893344#M352908</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-08T17:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 22-322: Expecting a name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893350#M352912</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option validvarname=any;

proc sql;
select customer as "Customer Name"n,
amount as "Transaction Amount"n format=Dollar10.2
from sq.transactionfull
where amount&amp;gt;1000 and service ne 'University'
order by 2 desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What you should actually do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option validvarname=V7;

proc sql;
create table temporary as 
select customer label="Customer Name",
amount label= "Transaction Amount" format=Dollar10.2
from sq.transactionfull
where amount&amp;gt;1000 and service ne 'University'
order by 2 desc;
quit;

proc print data=temporary labels;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SQL doesn't have the concept of labels, SAS does, they are powerful and help you out. If you're using SAS regularly, it's worth understanding them and how to use them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/451750"&gt;@xun1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;68&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;69 proc sql;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;70 select Customer as "Customer Name",&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;_______________&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;71 Amount as "Transaction Amount" format=DOLLAR10.2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;____________________&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4" color="#FF0000"&gt;&lt;STRONG&gt;ERROR 22-322: Expecting a name.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;72 from sq.transactionfull&lt;/DIV&gt;
&lt;DIV class=""&gt;73 where Amount &amp;gt; 1000 and Service ne 'University'&lt;/DIV&gt;
&lt;DIV class=""&gt;74 order by Amount desc;&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/DIV&gt;
&lt;DIV class=""&gt;75 title "Large Non-Educational Transactions";&lt;/DIV&gt;
&lt;DIV class=""&gt;76 quit;&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;
&lt;DIV class=""&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/DIV&gt;
&lt;DIV class=""&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class=""&gt;user cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class=""&gt;system cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class=""&gt;memory 225.59k&lt;/DIV&gt;
&lt;DIV class=""&gt;OS Memory 19104.00k&lt;/DIV&gt;
&lt;DIV class=""&gt;Timestamp 09/08/2023 02:25:41 PM&lt;/DIV&gt;
&lt;DIV class=""&gt;Step Count 154 Switch Count 1&lt;/DIV&gt;
&lt;DIV class=""&gt;Page Faults 0&lt;/DIV&gt;
&lt;DIV class=""&gt;Page Reclaims 17&lt;/DIV&gt;
&lt;DIV class=""&gt;Page Swaps 0&lt;/DIV&gt;
&lt;DIV class=""&gt;Voluntary Context Switches 7&lt;/DIV&gt;
&lt;DIV class=""&gt;Involuntary Context Switches 0&lt;/DIV&gt;
&lt;DIV class=""&gt;Block Input Operations 0&lt;/DIV&gt;
&lt;DIV class=""&gt;Block Output Operations 16&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;77&lt;/DIV&gt;
&lt;DIV class=""&gt;78&lt;/DIV&gt;
&lt;DIV class=""&gt;79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class=""&gt;89&lt;/DIV&gt;
&lt;PRE class=""&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 17:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-22-322-Expecting-a-name/m-p/893350#M352912</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-09-08T17:58:08Z</dc:date>
    </item>
  </channel>
</rss>

