<?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: converting numeric to character by put statement: how to avoid &amp;quot;.&amp;quot; for missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322047#M71196</link>
    <description>&lt;P&gt;the option&amp;nbsp;&lt;STRONG&gt;options missing=' '; &lt;/STRONG&gt;affects &lt;U&gt;only&lt;/U&gt; how it is displayed.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 02:08:37 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-01-03T02:08:37Z</dc:date>
    <item>
      <title>converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322042#M71191</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when I use put statement to convert a numeric&amp;nbsp;variable to character one, using the following code will make missings to '.', not blank.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;VSSTRESC=strip(put(VSRESPORRES,best.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I need to use the following code to avoid '.'&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if VSRESPORRES ne . then  VSSTRESC=strip(put(VSRESPORRES,best.));
				else VSSTRESC='';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have many such variables to convert. I wonder if there is an easier way&amp;nbsp;to avoid it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 01:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322042#M71191</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-01-03T01:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322043#M71192</link>
      <description>&lt;P&gt;add&amp;nbsp;&lt;STRONG&gt;options missing=' ';&lt;/STRONG&gt; before your step&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 01:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322043#M71192</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-03T01:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322045#M71194</link>
      <description>&lt;P&gt;Thank you. Will this option statement affect the missing values of numeric varaibles in the same data step?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 02:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322045#M71194</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-01-03T02:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322047#M71196</link>
      <description>&lt;P&gt;the option&amp;nbsp;&lt;STRONG&gt;options missing=' '; &lt;/STRONG&gt;affects &lt;U&gt;only&lt;/U&gt; how it is displayed.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 02:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322047#M71196</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-03T02:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322049#M71197</link>
      <description>&lt;P&gt;If you're lazy, you can use CATT, it does an automatic conversion, with no message in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option missing='';

data class;
	set sashelp.class;

	if age=13 then
		weight=.;
run;

data check;
	set class;
	test1=catt(weight);
	test2=put(weight, best.);
run;

title 'Missing with space';

proc print data=check (obs=5);
run;

option missing=.;
title 'Missing with period';

proc print data=check(obs=5);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 02:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322049#M71197</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-03T02:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric to character by put statement: how to avoid "." for missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322053#M71201</link>
      <description>&lt;P&gt;As an alternative to the missing option which affects how missings are printed for all numerical variables, you can also define your own format as demontrated in the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also: To get your result left aligned you could use&amp;nbsp;syntax &lt;EM&gt;&amp;lt;format name&amp;gt;.-L&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value MyBest(default=16)
  low-high=[best.]
  other=' ';
run;

data sample;
  VSRESPORRES=1;
  VSSTRESC=put(VSRESPORRES,MyBest.-L);
  output;
  VSRESPORRES=.;
  VSSTRESC=put(VSRESPORRES,MyBest.-L);
  output;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jan 2017 03:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-numeric-to-character-by-put-statement-how-to-avoid/m-p/322053#M71201</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-03T03:02:27Z</dc:date>
    </item>
  </channel>
</rss>

