<?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: Removing special missings when exporting to a csv in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402871#M66867</link>
    <description>&lt;P&gt;You have to apply to each column so if you have comma or currency formats it can be a pain.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use variable lists at least:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_numeric_ -&amp;gt; all numeric variables&lt;/P&gt;
&lt;P&gt;var1 -- var100 -&amp;gt; all variables that are listed between var1 and var100&lt;/P&gt;
&lt;P&gt;var1-var100 all variables indexed with var1-var100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 17:32:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-10T17:32:38Z</dc:date>
    <item>
      <title>Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402832#M66853</link>
      <description>&lt;P&gt;Hi, I have a large dataset with over a thousand columns. All are coded with some special missing characters. Is there any way to export this to a .csv without retaining the special missings? I want to only have one type of missing data because this is causing my csv to have unique values like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;P&gt;F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead I want only unique values:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;-Brianna&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402832#M66853</guid>
      <dc:creator>briannalindsay</dc:creator>
      <dc:date>2017-10-10T16:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402836#M66854</link>
      <description>&lt;P&gt;So you want to exclude all missing data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170788"&gt;@briannalindsay&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I have a large dataset with over a thousand columns. All are coded with some special missing characters. Is there any way to export this to a .csv without retaining the special missings? I want to only have one type of missing data because this is causing my csv to have unique values like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;A&lt;/P&gt;
&lt;P&gt;T&lt;/P&gt;
&lt;P&gt;F&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead I want only unique values:&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;-Brianna&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402836#M66854</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T16:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402838#M66855</link>
      <description>&lt;P&gt;No, I want all missing data (including special missing) to be exported as missing rather than coded as 'A', 'F', 'T' etc.&amp;nbsp;The program that I'm using doesn't recognize special missings therefore I have many columns that have random single character responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the only way to do this to recode before I export?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402838#M66855</guid>
      <dc:creator>briannalindsay</dc:creator>
      <dc:date>2017-10-10T16:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402840#M66856</link>
      <description>&lt;P&gt;How are you exporting your data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you create a replication using the CLASS or CARS data set?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402840#M66856</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T16:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402845#M66857</link>
      <description>&lt;P&gt;I have tried exporting both by proc export and by ods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In SAS the data would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;input var1 $ var2 $ var3 ;&lt;BR /&gt;datalines;&lt;BR /&gt;a a _a&lt;BR /&gt;b b _b&lt;BR /&gt;c c _c&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I export to csv it would look like this:&lt;/P&gt;&lt;P&gt;var1 var2 var3&lt;/P&gt;&lt;P&gt;a a A&lt;/P&gt;&lt;P&gt;b b B&lt;/P&gt;&lt;P&gt;c c C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I want it to look like this:&lt;/P&gt;&lt;P&gt;var1 var2 var3&lt;/P&gt;&lt;P&gt;a a .&lt;/P&gt;&lt;P&gt;b b .&lt;/P&gt;&lt;P&gt;c c .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402845#M66857</guid>
      <dc:creator>briannalindsay</dc:creator>
      <dc:date>2017-10-10T16:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402850#M66858</link>
      <description>&lt;P&gt;You could try a custom format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options missing='.';&lt;BR /&gt;proc format;&lt;BR /&gt;value num_custom_fmt&lt;BR /&gt;., .A-.Z = .&lt;BR /&gt;other = [best12.];&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc print data=test;&lt;BR /&gt;format var3 num_custom_fmt.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 17:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402850#M66858</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402865#M66864</link>
      <description>&lt;P&gt;Would this work for all columns or would I have to do each column one by one?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 17:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402865#M66864</guid>
      <dc:creator>briannalindsay</dc:creator>
      <dc:date>2017-10-10T17:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402871#M66867</link>
      <description>&lt;P&gt;You have to apply to each column so if you have comma or currency formats it can be a pain.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use variable lists at least:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_numeric_ -&amp;gt; all numeric variables&lt;/P&gt;
&lt;P&gt;var1 -- var100 -&amp;gt; all variables that are listed between var1 and var100&lt;/P&gt;
&lt;P&gt;var1-var100 all variables indexed with var1-var100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 17:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402871#M66867</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T17:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Removing special missings when exporting to a csv</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402992#M66871</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170788"&gt;@briannalindsay&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You could also create an intermediary dataset for export where you convert all the special missings to standard missings as done below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data period_a;
  missing X I;
  input Id $4. Foodpr1 Foodpr2 Foodpr3 Coffeem1 Coffeem2;
  datalines;
1001 115 45 65 I 78
1002 86 27 55 72 86
1004 93 52 X 76 88
1015 73 35 43 112 108
1027 101 127 39 76 79
;
run;

options missing=' ';
data ds_for_export;
  set period_a;
  array nums _numeric_;
  do over nums;
    if missing(nums) then call missing(nums);
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;options missing=' ';&lt;/EM&gt; is used to then print/write the standard missings as blanks and not as dots.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 23:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-special-missings-when-exporting-to-a-csv/m-p/402992#M66871</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-10T23:54:25Z</dc:date>
    </item>
  </channel>
</rss>

