<?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: Setting a missing value to a variable using create format in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357443#M23524</link>
    <description>&lt;P&gt;Sorry, I dont know what a "format task" is, not that familiar with EG anymore. &amp;nbsp;However it is a very simple task in code:&lt;/P&gt;
&lt;PRE&gt;proc format;
  value $gender
    "M"="male"
    "F"="female"
    other=" ";
run;

data want;
  set have;
  format gender $gender.;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 May 2017 12:32:57 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-05-10T12:32:57Z</dc:date>
    <item>
      <title>Setting a missing value to a variable using create format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357426#M23523</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to set the values of a variable to MISSING ('') using the create format task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the original table looks somewhat like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gender&lt;/P&gt;&lt;P&gt;Wally&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U&lt;/P&gt;&lt;P&gt;Walter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&lt;/P&gt;&lt;P&gt;Violeta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F&lt;/P&gt;&lt;P&gt;Viktor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&lt;/P&gt;&lt;P&gt;Viktoria&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victoria&amp;nbsp;&amp;nbsp;&amp;nbsp; F&lt;/P&gt;&lt;P&gt;Victoria&lt;/P&gt;&lt;P&gt;Tim&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Gender is classified as F for female, M for male, U or MISSING value for undefined.&lt;/P&gt;&lt;P&gt;I like to set all gender values of&lt;/P&gt;&lt;P&gt;'F' to 'female',&lt;/P&gt;&lt;P&gt;'M' to 'male' and&lt;/P&gt;&lt;P&gt;'U' or MISSING value to MISSING.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Afterwards the table should look like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gender&lt;/P&gt;&lt;P&gt;Wally&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Walter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;Violeta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; female&lt;/P&gt;&lt;P&gt;Viktor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;Viktoria&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victoria&amp;nbsp;&amp;nbsp;&amp;nbsp; female&lt;/P&gt;&lt;P&gt;Victoria&lt;/P&gt;&lt;P&gt;Tim&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do so by using the create format task but if I leave the label for "all other values" empty I get two single quotaion marks ('') instead of empty entries. My table looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gender&lt;/P&gt;&lt;P&gt;Wally&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''&lt;/P&gt;&lt;P&gt;Walter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;Violeta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; female&lt;/P&gt;&lt;P&gt;Viktor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;Viktoria&amp;nbsp;&amp;nbsp;&amp;nbsp; ''&lt;/P&gt;&lt;P&gt;Victoria&amp;nbsp;&amp;nbsp;&amp;nbsp; female&lt;/P&gt;&lt;P&gt;Victoria&amp;nbsp;&amp;nbsp;&amp;nbsp; ''&lt;/P&gt;&lt;P&gt;Tim&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if it is possible to do this with the create format task or do ii have to use a CASE-WHEN-THEN-ELSE statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13805i66B17AD8E628859D/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="code format gender.PNG" title="code format gender.PNG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13806i3018154C7623EFCF/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="UI create format gender.PNG" title="UI create format gender.PNG" /&gt;</description>
      <pubDate>Wed, 10 May 2017 11:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357426#M23523</guid>
      <dc:creator>M4XF</dc:creator>
      <dc:date>2017-05-10T11:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a missing value to a variable using create format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357443#M23524</link>
      <description>&lt;P&gt;Sorry, I dont know what a "format task" is, not that familiar with EG anymore. &amp;nbsp;However it is a very simple task in code:&lt;/P&gt;
&lt;PRE&gt;proc format;
  value $gender
    "M"="male"
    "F"="female"
    other=" ";
run;

data want;
  set have;
  format gender $gender.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 May 2017 12:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357443#M23524</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-10T12:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a missing value to a variable using create format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357447#M23525</link>
      <description>&lt;P&gt;Hi RW9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your answer.&lt;/P&gt;&lt;P&gt;I myself came from SAS Base and I know that it is easy to do in code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What makes me wonder is that the EPG sets exactly the code you produced (see attached picture in orig post) but gives me two simple quotation marks instead of an empty entry.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 07:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357447#M23525</guid>
      <dc:creator>M4XF</dc:creator>
      <dc:date>2017-05-11T07:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a missing value to a variable using create format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357454#M23527</link>
      <description>&lt;P&gt;Please select the all other values from the drop down where all other values is highlighted that way for other values we get the blank&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Capture1.JPG" alt="Capture1.JPG" src="https://communities.sas.com/t5/image/serverpage/image-id/8792i86BA35208CB635F5/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 12:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357454#M23527</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-05-10T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a missing value to a variable using create format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357765#M23548</link>
      <description>&lt;P&gt;Hi Jag,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it the same way, but what happend was that for all other values I got two single quotation marks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use a format created like you did (named $Gender.) I get the results as shown in the provided picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for column Gender_1:&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN t1.Gender_orig = 'W' THEN 'Weibl.'&lt;BR /&gt;WHEN t1.Gender_orig = 'M' THEN 'Männl.'&lt;BR /&gt;ELSE ''&lt;BR /&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for Gender_2:&lt;/P&gt;&lt;P&gt;PUT(t1.Gender_orig, $Gender.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for Gender_3:&lt;/P&gt;&lt;P&gt;use format $Gender. as output format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13817iDFB416F11B8DF2E9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="gender example.PNG" title="gender example.PNG" /&gt;</description>
      <pubDate>Thu, 11 May 2017 06:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-a-missing-value-to-a-variable-using-create-format/m-p/357765#M23548</guid>
      <dc:creator>M4XF</dc:creator>
      <dc:date>2017-05-11T06:26:41Z</dc:date>
    </item>
  </channel>
</rss>

