<?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: Macro error inside another macro- when writing to a macro variable dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650743#M195164</link>
    <description>&lt;P&gt;&lt;FONT size="6"&gt;&lt;STRONG&gt;ALWAYS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;use this button for posting logs:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Bildschirmfoto 2020-04-07 um 08.32.59.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;as otherwise the horizontal formatting will be destroyed, and lots of useful information for debugging is lost.&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 13:34:03 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-05-26T13:34:03Z</dc:date>
    <item>
      <title>Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650713#M195154</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I am getting the below error when write to a SAS Dataset in a macro ..&amp;nbsp; is the " ; "&amp;nbsp; causing the error ? In the SAS code that I have pasted below , i tried putting a %str around the dataset but no luck.&lt;/P&gt;
&lt;P&gt;Can any one please help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log ERROR:&lt;/P&gt;
&lt;P&gt;*-----------------------------------*&lt;/P&gt;
&lt;P&gt;MPRINT(IMPORT_STRATEGICFILE): &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN,&lt;/FONT&gt; &lt;BR /&gt;LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=. &lt;BR /&gt;SYMBOLGEN: Macro variable OUTPUT_FILE resolves to STRATEGIC_EXPORT&lt;BR /&gt;MPRINT(IMPORT_STRATEGICFILE): data MY_LIB.STRATEGIC_EXPORT;&lt;BR /&gt;MPRINT(IMPORT_STRATEGICFILE): Format Response_File_Load_Date date9.;&lt;BR /&gt;SYMBOLGEN: Macro variable OUTPUT_FILE resolves to STRATEGIC_EXPORT&lt;BR /&gt;MPRINT(IMPORT_STRATEGICFILE): set work.STRATEGIC_EXPORT;&lt;BR /&gt;SYMBOLGEN: Macro variable FILE_UPLOAD_DATE resolves to 21MAY2020&lt;BR /&gt;MPRINT(IMPORT_STRATEGICFILE): Response_File_Load_Date=21MAY2020;&lt;BR /&gt;MPRINT(IMPORT_STRATEGICFILE): run;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2020-05-26T22:48:27,041+10:00| _DISARM| WorkspaceServer| _DISARM| SAS| &lt;BR /&gt;_DISARM| | _DISARM| | _DISARM| 29663232| _DISARM| 11| _DISARM| 11| _DISARM| 4065| _DISARM| 12053868| _DISARM| 0.015625| &lt;BR /&gt;_DISARM| 0.015000| _DISARM| 1906116507.027000| _DISARM| 1906116507.042000| _DISARM| 0.015625| _DISARM| | _ENDDISARM &lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;WARNING: The data set MY_LIB.STRATEGIC_EXPORT may be incomplete. When this step was stopped there were 0 observations and 85&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data MY_LIB.&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;%str&lt;/FONT&gt;&lt;/STRONG&gt;(&amp;amp;output_file.);&lt;BR /&gt;Format Response_File_Load_Date date9.;&lt;BR /&gt;set work.&amp;amp;output_file.;&lt;BR /&gt;Response_File_Load_Date=&amp;amp;file_upload_date.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;variables.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 12:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650713#M195154</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-05-26T12:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650720#M195156</link>
      <description>&lt;P&gt;Please follow these instructions to help us better interpret the LOG you are showing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paste the log as text into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650720#M195156</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-26T13:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650722#M195157</link>
      <description>&lt;PRE&gt;MPRINT(IMPORT_STRATEGICFILE): Response_File_Load_Date=21MAY2020;&lt;/PRE&gt;
&lt;P&gt;When you create macros, they produce text that must be VALID legal working SAS code. Your macro produces the above line of code. The above line is not a valid line in a DATA step, it does not work and causes an error. Can you figure out why the above line of code is not valid in a DATA step?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650722#M195157</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-26T13:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650727#M195159</link>
      <description>is it because it's a data and should be '21MAY2020'd##- Please type your&lt;BR /&gt;reply above this line. No attachments. -##</description>
      <pubDate>Tue, 26 May 2020 13:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650727#M195159</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-05-26T13:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650731#M195161</link>
      <description>&lt;P&gt;So can you now fix the DATA step code to properly make use of macro variable &amp;amp;&lt;SPAN&gt;file_upload_date ??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650731#M195161</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-26T13:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650743#M195164</link>
      <description>&lt;P&gt;&lt;FONT size="6"&gt;&lt;STRONG&gt;ALWAYS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;use this button for posting logs:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Bildschirmfoto 2020-04-07 um 08.32.59.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;as otherwise the horizontal formatting will be destroyed, and lots of useful information for debugging is lost.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650743#M195164</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-26T13:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650749#M195167</link>
      <description>&lt;PRE&gt;SYMBOLGEN: Macro variable FILE_UPLOAD_DATE resolves to 21MAY2020&lt;/PRE&gt;
&lt;P&gt;See Maxim 28.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650749#M195167</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-26T13:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650753#M195170</link>
      <description>&lt;P&gt;You should NOT add macro quoting around the name of a dataset. The name of dataset cannot contain anything that would require macro quoting.&amp;nbsp; Plus the presence of the macro quoting might confuse the parser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This line of code being generated is not valid SAS syntax.&lt;/P&gt;
&lt;PRE&gt;MPRINT(IMPORT_STRATEGICFILE): Response_File_Load_Date=21MAY2020;&lt;/PRE&gt;
&lt;P&gt;What is it that you want on the right side of that assignment statement?&amp;nbsp; A string? A variable name? A date?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Response_File_Load_Date="21MAY2020";
Response_File_Load_Date="21MAY2020"n;
Response_File_Load_Date="21MAY2020"d;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 13:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650753#M195170</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-26T13:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error inside another macro- when writing to a macro variable dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650786#M195179</link>
      <description>&lt;P&gt;This line in your original code makes it clear that you were hoping to get a SAS date value into your new variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Format Response_File_Load_Date date9.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under those conditions, and given that &amp;amp;FILE_UPLOAD_DATE resolves to a value in the DATE9 format, your assignment statement should read:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Response_File_Load_Date="&amp;amp;file_upload_date."d;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 May 2020 14:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error-inside-another-macro-when-writing-to-a-macro/m-p/650786#M195179</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-05-26T14:47:56Z</dc:date>
    </item>
  </channel>
</rss>

