<?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 format of call symput in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358044#M84104</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column variable named Pvalue, then I use call symput to output a value. for example:&lt;/P&gt;&lt;P&gt;I have a simple dataset below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;variable &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pvalue &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pvalue_1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;score &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.00003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;0.001&lt;/P&gt;&lt;P&gt;math &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.02 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.02&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The format of Pvalue_1 is Pvalue5.3 get from Pvalue.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am using below code to output a variable's value:&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set scatter1;&lt;BR /&gt;if variable="score";&lt;BR /&gt;call symput("P", Pvalue_1);&lt;BR /&gt;run;&lt;BR /&gt;%put (&amp;amp;P);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But the output P is&amp;nbsp;0.00003 not&amp;nbsp;&amp;lt;0.001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Any idea to solve this? I want p is&amp;nbsp;&amp;lt;0.001.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Thanks,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2017 20:57:42 GMT</pubDate>
    <dc:creator>echoli</dc:creator>
    <dc:date>2017-05-11T20:57:42Z</dc:date>
    <item>
      <title>format of call symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358044#M84104</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column variable named Pvalue, then I use call symput to output a value. for example:&lt;/P&gt;&lt;P&gt;I have a simple dataset below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;variable &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pvalue &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pvalue_1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;score &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.00003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;0.001&lt;/P&gt;&lt;P&gt;math &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.02 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.02&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The format of Pvalue_1 is Pvalue5.3 get from Pvalue.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am using below code to output a variable's value:&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set scatter1;&lt;BR /&gt;if variable="score";&lt;BR /&gt;call symput("P", Pvalue_1);&lt;BR /&gt;run;&lt;BR /&gt;%put (&amp;amp;P);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But the output P is&amp;nbsp;0.00003 not&amp;nbsp;&amp;lt;0.001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Any idea to solve this? I want p is&amp;nbsp;&amp;lt;0.001.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Thanks,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 20:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358044#M84104</guid>
      <dc:creator>echoli</dc:creator>
      <dc:date>2017-05-11T20:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: format of call symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358046#M84105</link>
      <description>&lt;P&gt;A very small correction to your code solves this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data scatter1;
input variable $ Pvalue Pvalue_1 $;
datalines;
score 0.00003 &amp;lt;0.001
math 0.02 0.02
;

data _null_;
   set scatter1;
   if variable="score" then call symput("P", Pvalue_1);
run;
%put (&amp;amp;P);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 May 2017 21:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358046#M84105</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-05-11T21:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: format of call symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358047#M84106</link>
      <description>&lt;P&gt;If you do not specify a Format for your numeric variable&amp;nbsp;then the result is converted using BEST fromat&lt;/P&gt;
&lt;P&gt;Macro variables only handle text so you need to tell SAS exactly which text you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;call symput("P", Put(&amp;nbsp;Pvalue_1, pvalue6.3));&lt;/P&gt;
&lt;P&gt;That will have a trailing 0 for 0.020 but should not be a problem for most uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to consider using Call SYMPUTX to reduce the chances of unwanted leading spaces in some uses.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 22:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358047#M84106</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-11T22:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: format of call symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358050#M84107</link>
      <description>&lt;P&gt;Yes, that works!!&lt;/P&gt;&lt;P&gt;Thanks so much!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 21:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-of-call-symput/m-p/358050#M84107</guid>
      <dc:creator>echoli</dc:creator>
      <dc:date>2017-05-11T21:19:01Z</dc:date>
    </item>
  </channel>
</rss>

