<?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: CALL SYMPUTX - Default for optional parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751892#M236768</link>
    <description>Original q "in general, how do I see what the default value of the optional parameter"&lt;BR /&gt;Usually the doc standards are good and the default is explained. Here it is just cross referenced</description>
    <pubDate>Sat, 03 Jul 2021 10:53:08 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2021-07-03T10:53:08Z</dc:date>
    <item>
      <title>CALL SYMPUTX - Default for optional parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751711#M236675</link>
      <description>&lt;P&gt;In the CALL SYMNPUTX routine, the syntax is of the form:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CALL SYMPUTX (macro-variable, value &amp;lt;, symbol-table&amp;gt;);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By &amp;lt;&amp;gt; I know there is an optional paramater. But in general, how do I see what the default value of the optional parameter is?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For instance, reading the documentation, I could not see it:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.1/mcrolref/p1fa0ay5pzr9yun1mvqxv8ipzd4d.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/8.1/mcrolref/p1fa0ay5pzr9yun1mvqxv8ipzd4d.htm&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 12:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751711#M236675</guid>
      <dc:creator>SasStatistics</dc:creator>
      <dc:date>2021-07-02T12:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUTX - Default for optional parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751712#M236676</link>
      <description>&lt;P&gt;The three possible values for the optional argument seem to me to be spelled out clearly at that link. The default is also stated there: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you omit &lt;SPAN class="xis-userSuppliedValue"&gt;symbol-table&lt;/SPAN&gt;, or if &lt;SPAN class="xis-userSuppliedValue"&gt;symbol-table&lt;/SPAN&gt; is blank, CALL SYMPUTX stores the macro variable in the same symbol table as does the CALL SYMPUT routine.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 12:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751712#M236676</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-02T12:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUTX - Default for optional parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751714#M236677</link>
      <description>&lt;P&gt;You're actually entering a complex realm with that question.&amp;nbsp; You may not be happy that you asked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For simplicity sake, let's assume that you are running a macro, and don't have a situation where macros are calling other macros.&amp;nbsp; So the only two choices are the local symbol table and the global symbol table in this simplified scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First step:&amp;nbsp; see if that macro variable (first parameter in SYMPUTX) already exists.&amp;nbsp; Check the local symbol table first.&amp;nbsp; If the variable already exists there, replace it with the result from SYMPUTX.&amp;nbsp; If not, check the global symbol table.&amp;nbsp; If it exists there, replace it with the value from SYMPUTX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second step:&amp;nbsp; if the macro variable does not already exist in any existing symbol table, create it.&amp;nbsp; Where?&amp;nbsp; The answer depends on whether the local symbol table has any macro variables in it already.&amp;nbsp; If it does, add the SYMPUTX variable to the local symbol table.&amp;nbsp; If not, add it to the global symbol table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Technically, the reason for this complex behavior is that there is no such thing as an empty symbol table.&amp;nbsp; The local symbol table doesn't really get created until SAS needs to place a macro variable within it.&amp;nbsp; So SYMPUTX doesn't have a choice if the local symbol table is empty because that actually means the local table has not been created yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to expand this to the situation where macros are calling macros, so you have the possibility of each macro having its own local symbol table?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 12:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751714#M236677</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-07-02T12:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUTX - Default for optional parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751892#M236768</link>
      <description>Original q "in general, how do I see what the default value of the optional parameter"&lt;BR /&gt;Usually the doc standards are good and the default is explained. Here it is just cross referenced</description>
      <pubDate>Sat, 03 Jul 2021 10:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-Default-for-optional-parameter/m-p/751892#M236768</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2021-07-03T10:53:08Z</dc:date>
    </item>
  </channel>
</rss>

