<?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: change/set unknown to missing in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920062#M41214</link>
    <description>&lt;P&gt;Depending on your original data source, you might be able to handle this with a custom informat.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 07:04:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2024-03-13T07:04:58Z</dc:date>
    <item>
      <title>change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920049#M41206</link>
      <description>&lt;P&gt;I have a data set with 3991 observations and 2 variables (DMRN and Sex). The value of sex was recorded as Female, Male, and Unknown. &lt;STRONG&gt;I tried to set "unknown" to " "&lt;/STRONG&gt; by using an array but failed since the data set contain with both numeric and character variable. Can anyone help me with this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of the data set:&lt;/P&gt;&lt;P&gt;DMRN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sex&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Female&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Female&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Male&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Male&lt;/P&gt;&lt;P&gt;&amp;nbsp;3991&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Female&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 03:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920049#M41206</guid>
      <dc:creator>tan-wongv</dc:creator>
      <dc:date>2024-03-13T03:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920050#M41207</link>
      <description>&lt;P&gt;In the simplest situation, you don't really need array.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input DMRN Sex $;
  cards;
1    Female
2    Female
3    Male
4    Unknown
5    Male
3991 Female
;
run;

data want;
  set have;
  if sex='Unknown' then sex='';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this does't help, please tell more details about your situation.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920050#M41207</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2024-03-13T04:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920051#M41208</link>
      <description>&lt;P&gt;Thank you for your response. I tried this before but unknown still remained. It did not change to ' '.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920051#M41208</guid>
      <dc:creator>tan-wongv</dc:creator>
      <dc:date>2024-03-13T04:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920053#M41209</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-13 001420.png" style="width: 190px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94598i7C1E9670137E2082/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-03-13 001420.png" alt="Screenshot 2024-03-13 001420.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is my data set. only one sample with DMRN 3346 has unknown sex. I tried&amp;nbsp;&lt;BR /&gt;data want;&lt;/P&gt;&lt;P&gt;set sex;&lt;/P&gt;&lt;P&gt;if sex = 'unknown' then sex = ' ';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;But when I check the table it's still labeled as unknown.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920053#M41209</guid>
      <dc:creator>tan-wongv</dc:creator>
      <dc:date>2024-03-13T04:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920054#M41210</link>
      <description>&lt;P&gt;It's possible that your variable sex got a format attached to it and that you're trying to use the formatted values. Please run below code and share with us the result of the two procedures.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  set &lt;FONT color="#0000FF"&gt;&amp;lt;your table&amp;gt;&lt;/FONT&gt;;
  sex2=sex;
run;

proc contents data=test(keep=sex);
run;
proc freq data=test;
  table sex2 /missing nocol norow nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920054#M41210</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-03-13T04:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920055#M41211</link>
      <description>&lt;P&gt;Text comparisons are case-sensitive. Your code needs to do an exact comparison:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;

set sex;

if sex = 'Unknown' then sex = ' ';
* or try this: if upcase(sex) = 'UNKNOWN' then sex = ' ';

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 04:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920055#M41211</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-03-13T04:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920062#M41214</link>
      <description>&lt;P&gt;Depending on your original data source, you might be able to handle this with a custom informat.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 07:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920062#M41214</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-13T07:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920197#M41219</link>
      <description>&lt;P&gt;Thank you so much! I tried the upcase and now it works!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 20:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920197#M41219</guid>
      <dc:creator>tan-wongv</dc:creator>
      <dc:date>2024-03-13T20:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: change/set unknown to missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920198#M41220</link>
      <description>Thank you for your help!</description>
      <pubDate>Wed, 13 Mar 2024 20:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-set-unknown-to-missing/m-p/920198#M41220</guid>
      <dc:creator>tan-wongv</dc:creator>
      <dc:date>2024-03-13T20:34:19Z</dc:date>
    </item>
  </channel>
</rss>

