<?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 with a CAT's in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488689#M127412</link>
    <description>&lt;P&gt;After the macro variable is resolved, you get this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file=cat("'",&amp;amp;Fleet_Type, " P/N 12 MOnth Rolling'")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which is obviously invalid.&lt;/P&gt;
&lt;P&gt;To use a data step function in a %let, you need to use %sysfunc. Also note that concatenation in macro is done simply by writing text in sequence:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;fleet_type._rest_of_the_filename&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also note that blanks in filenames are bad. Use underlines instead.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 19:19:35 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-21T19:19:35Z</dc:date>
    <item>
      <title>Error 22-322 with a CAT's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488681#M127406</link>
      <description>&lt;P&gt;I have the following let statements that are causing an error 22-322:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let Excel_Sheet_Name = cat("'",&amp;amp;Fleet_Type, " P/N 12 MOnth Rolling'");&lt;BR /&gt;%let Excel_File_Name = cat("'",&amp;amp;Fleet_Type, " MTBR.xml'");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;44 ods tagsets.excelxp path='\\Cmhprdfps22\data\MAINTENANCE\Reliability\Program Analyst Data\Dave P\SAS AutoBatch Exports\'&lt;BR /&gt;45 file=&amp;amp;Excel_File_Name&lt;BR /&gt;46 style=Grayscaleprinter;&lt;BR /&gt;NOTE: Line generated by the macro variable "EXCEL_FILE_NAME".&lt;BR /&gt;46 cat("'","CE-560XL", " MTBR.xml'")&lt;BR /&gt;2 The SAS System 10:54 Tuesday, August 21, 2018&lt;/P&gt;&lt;P&gt;___&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: DYNAMIC, NO_BOTTOM_MATTER, NO_TOP_MATTER, TITLE, URL.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;47&lt;BR /&gt;48 ods tagsets.ExcelXP options(sheet_label=' ' sheet_name=&amp;amp;Excel_Sheet_Name autofilter='yes');&lt;BR /&gt;NOTE: Line generated by the macro variable "EXCEL_SHEET_NAME".&lt;BR /&gt;48 cat("'","CE-560XL", " P/N 12 MOnth Rolling'")&lt;BR /&gt;___&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR 22-322: Expecting a quoted string.&lt;BR /&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 19:09:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488681#M127406</guid>
      <dc:creator>edge900rr</dc:creator>
      <dc:date>2018-08-21T19:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 with a CAT's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488686#M127409</link>
      <description>&lt;P&gt;Macro language does not typically use CAT to combine strings.&amp;nbsp; In fact, if you want to use CAT in macro language, you need to enclose it within %SYSFUNC.&amp;nbsp; Easier to read (once you are used to it), and able to overcome the need to resolve a macro variable in single quotes, might be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;%let Excel_Sheet_Name = %unquote(%str(%'&amp;amp;Fleet_Type P/N 12 MOnth Rolling%'));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Within %STR, refer to single quotes with a percent sign:&amp;nbsp; %'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 19:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488686#M127409</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-21T19:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 with a CAT's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488688#M127411</link>
      <description>Cat is a data-step function, if you want to use it in a %let statement you have to wrap it in %sysfunc. If you want to concatenate strings in macro code you don't have to use cat at all. And, please avoid quotes in macro variables, add them when using the variable. Try:&lt;BR /&gt;&lt;BR /&gt;%let Excel_Sheet_Name = &amp;amp;Fleet_Type. P/N 12 Month Rolling;&lt;BR /&gt;%let Excel_File_Name = &amp;amp;Fleet_Type. MTBR.xml;&lt;BR /&gt;&lt;BR /&gt;And later: file= "&amp;amp;Excel_File_Name."&lt;BR /&gt;Same for the sheet-name option.</description>
      <pubDate>Tue, 21 Aug 2018 19:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488688#M127411</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-08-21T19:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 with a CAT's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488689#M127412</link>
      <description>&lt;P&gt;After the macro variable is resolved, you get this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file=cat("'",&amp;amp;Fleet_Type, " P/N 12 MOnth Rolling'")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which is obviously invalid.&lt;/P&gt;
&lt;P&gt;To use a data step function in a %let, you need to use %sysfunc. Also note that concatenation in macro is done simply by writing text in sequence:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;fleet_type._rest_of_the_filename&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also note that blanks in filenames are bad. Use underlines instead.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 19:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488689#M127412</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-21T19:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 with a CAT's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488693#M127415</link>
      <description>&lt;P&gt;Sweet.&amp;nbsp; Thanks!!!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 19:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-with-a-CAT-s/m-p/488693#M127415</guid>
      <dc:creator>edge900rr</dc:creator>
      <dc:date>2018-08-21T19:27:15Z</dc:date>
    </item>
  </channel>
</rss>

