<?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: Is there any simple way to show values of all function parameters? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511971#M137822</link>
    <description>&lt;P&gt;Use a variable list.&lt;/P&gt;
&lt;P&gt;Your function call&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x = finance('xirr', a, b, c, d, e, f, g, h, i, j, 0.1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;could also be written as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x = finance('xirr',of  a b c d e f g h i j 0.1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So put that list of variables/values into a macro variable and use it in both the assignment statement and a PUT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varlist= a b c d e f g h i j;
...
x = finance('xirr',of &amp;amp;varlist 0.1);
put (x &amp;amp;varlist) (=);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Nov 2018 22:03:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-11-10T22:03:11Z</dc:date>
    <item>
      <title>Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511922#M137802</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any simple way to show values of all function parameters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex. I have the following program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
... 
x = finance('xirr', a, b, c, d, e, f, g, h, i, j, 0.1);
..
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of cause, I can use put instructions just before function calling&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
...
put a=;
put b=;
put c=;
put d=;
put e=;
put f=;
put g=;
put h=;
put i=;
put j=;
x = finance('xirr', a, b, c, d, e, f, g, h, i, j, 0.1);
...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;But can I add some single instruction (or option) to automatically show all values of function parameters in log when it is executed? Ex. option mlogic allows us printing all values of macro parameters. May be there is some analogue of this option for SAS functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 11:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511922#M137802</guid>
      <dc:creator>DmitryErshov</dc:creator>
      <dc:date>2018-11-10T11:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511925#M137803</link>
      <description>&lt;P&gt;Hi Dimitri,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish there was. But, caveat emptor, there isn't. You could shorten your example of putting all variables by using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put _all_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But that's as good as it gets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;-- Jan.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 13:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511925#M137803</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2018-11-10T13:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511928#M137806</link>
      <description>&lt;P&gt;If you like you can code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arg {*} a b c d e f g h i;
do _m_ = 1 to dim(arg);
    put  strip(vname(arg(_M)))  ' = ' arg(_M_);
end;
drop _m_;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Nov 2018 15:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511928#M137806</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-10T15:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511930#M137807</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37016"&gt;@DmitryErshov&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
...
put a=;
put b=;
put c=;
put d=;
put e=;
put f=;
put g=;
put h=;
put i=;
put j=;
x = finance('xirr', a, b, c, d, e, f, g, h, i, j, 0.1);
...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37016"&gt;@DmitryErshov&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;put (a--j)(=);&lt;/PRE&gt;
&lt;P&gt;would&amp;nbsp;not only be shorter code, but normally also take up less space in the log. However, it requires that &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt; is the first&amp;nbsp;and &lt;FONT face="courier new,courier"&gt;j&lt;/FONT&gt; the last variable of the list&amp;nbsp;&lt;SPAN&gt;in the order of their logical position in the data set (see PROC CONTENTS output with VARNUM option).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In many practical applications SAS handles so many observations that such log output would become unwieldy. A common situation where it &lt;EM&gt;is&lt;/EM&gt; very useful to display variable values and to see how they change&amp;nbsp;during a DATA step is the debugging process.&amp;nbsp;The&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lebaseutilref/64791/HTML/default/viewer.htm#n06w89msxn3za7n10g5sx25pa0j0.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;data step debugger&lt;/A&gt;&amp;nbsp;does have this functionality. Please see this post for a&amp;nbsp;brief instruction:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/use-of-index/m-p/264460#M51865" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/use-of-index/m-p/264460#M51865&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 15:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511930#M137807</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-10T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511950#M137812</link>
      <description>&lt;P&gt;Thank you very much for your replies!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Dmitry&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 18:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511950#M137812</guid>
      <dc:creator>DmitryErshov</dc:creator>
      <dc:date>2018-11-10T18:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511959#M137816</link>
      <description>And you can use _numeric_ or _character_ to refer to numeric or character variables.</description>
      <pubDate>Sat, 10 Nov 2018 18:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511959#M137816</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-10T18:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511971#M137822</link>
      <description>&lt;P&gt;Use a variable list.&lt;/P&gt;
&lt;P&gt;Your function call&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x = finance('xirr', a, b, c, d, e, f, g, h, i, j, 0.1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;could also be written as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x = finance('xirr',of  a b c d e f g h i j 0.1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So put that list of variables/values into a macro variable and use it in both the assignment statement and a PUT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varlist= a b c d e f g h i j;
...
x = finance('xirr',of &amp;amp;varlist 0.1);
put (x &amp;amp;varlist) (=);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 22:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511971#M137822</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-10T22:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511974#M137825</link>
      <description>If you wish this effect, you could implement a base was macro&lt;BR /&gt; macro, something like&lt;BR /&gt;&lt;BR /&gt;%mycaller( functionname, parm1=  value, parm2= value, parm= value...... )&lt;BR /&gt;The %mycaller macro is designed to call the regular function named as the positional parameter. The design needs to use the syspbuf macro option to support whatever parameter list the function needs. To support stable code which doesnt change when function parameter reporting is no longer needed, some trigger (for example a special macro parameter, alternatively it could be a macro var in global or the calling environment) needs to indicate whether or not the macro is to report the parameter values (at runtime not compile time). As this implies a separate (put) statement unfortunately the %mycaller macro cannot be a (my preference) function macro&lt;BR /&gt;</description>
      <pubDate>Sat, 10 Nov 2018 22:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511974#M137825</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2018-11-10T22:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any simple way to show values of all function parameters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511975#M137826</link>
      <description />
      <pubDate>Sat, 10 Nov 2018 22:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-simple-way-to-show-values-of-all-function/m-p/511975#M137826</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2018-11-10T22:27:04Z</dc:date>
    </item>
  </channel>
</rss>

