<?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: Creating Dummy Variables as Characters in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506491#M1335</link>
    <description>&lt;P&gt;Please post some sample data and the code you actually ran.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the line you're asking about, the right hand side of the equation is testing if the variable is equal to Y. In SAS true is returned as 1 and false as 0, so you can avoid the IF/THEN portion and just check if they're equal and get the desired values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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/220905"&gt;@hjones_6&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I tried the code that you suggested but I am still getting this output: a 0 for email1_email_opened when email1 was 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you could walk me through this line of code to help understand what it is saying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;AA01044_EMAIL_OPENED_dummy =  (AA01044_EMAIL_OPENED = 'Y');&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Oct 2018 16:04:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-22T16:04:29Z</dc:date>
    <item>
      <title>Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506025#M1240</link>
      <description>&lt;P&gt;I am working on creating dummy variables for emails.&amp;nbsp; In this data set there is the email (email1) and then whether they opened email1 (email1_email_opened) and then whether they clicked on a call to action link in the email (email1_email_clicked).&amp;nbsp; When creating these dummy variables for the three original variables I don't want there to be a 0 for the email opened dummy if they did not receive it.&amp;nbsp; Same thing with the clicking on it variable.&amp;nbsp; This would be misrepresentation and could lead to incorrect results.&amp;nbsp; Below is the code that I have so far, however it is not running as I would like.&amp;nbsp; It is still outputting a 0 for email1_email_opened when email1 was 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should also note that when I don't want to have a misrepresentation, I am looking to place a '.' there.&amp;nbsp; So this would make the variable a character variable.&amp;nbsp; Maybe that is what is going wrong, but I have been working on this for hours.&amp;nbsp; I have also attached a sample of the dataset to farther help understand this question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;email1 = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; email1_Dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; email1_Dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; email1_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'.'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_Click_dum = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'.'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_click_dum = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'.'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_CLICKED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_click_dum = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Sample Dataset:&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;email1&lt;/TD&gt;&lt;TD&gt;email1_email_opened&lt;/TD&gt;&lt;TD&gt;email1_email_clicked&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506025#M1240</guid>
      <dc:creator>hjones_6</dc:creator>
      <dc:date>2018-10-19T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506039#M1243</link>
      <description>&lt;P&gt;Your IF statements are misformed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if&amp;nbsp;email1_dummy =&amp;nbsp;'0'&amp;nbsp;then&amp;nbsp;email1_EMAIL_OPENED_dummy =&amp;nbsp;'.'

and&amp;nbsp;email1_Click_dum =&amp;nbsp;'.';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if&amp;nbsp;email1_dummy =&amp;nbsp;'0'&amp;nbsp;then&amp;nbsp;call missing( email1_EMAIL_OPENED_dummy,  email1_Click_dum);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In general, I think this is what you want. Another work around is to set all to missing at the top of your program and then assign to 1/0 as needed later on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if email1 = 'Y' then email1_Dummy = 1;

else do;
    email1_Dummy = 0;
    call missing(email1_email_opened_dummy, email1_click_dum);
end;

email1_EMAIL_OPENED_dummy =  (email1_EMAIL_OPENED = 'Y');

if email1_EMAIL_OPENED_dummy = 0 then call missing(email1_click_dum);
if email1_EMAIL_CLICKED = 'Y' then email1_click_dum = 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506039#M1243</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T16:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506058#M1248</link>
      <description>&lt;P&gt;so would it look like this then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;email1 = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; email1_Dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_Dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; missing( &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy, &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_Click_dum);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_OPENED_dummy = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; missing( &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_click_dum);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_EMAIL_CLICKED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;FONT face="Courier New"&gt;email1&lt;/FONT&gt;_click_dum = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this and it still was giving me the output that I received with the first set of code I tried to run in the original post.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506058#M1248</guid>
      <dc:creator>hjones_6</dc:creator>
      <dc:date>2018-10-19T17:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506070#M1253</link>
      <description>Did you try the code I posted? Not sure why  you want it character, I really wouldn't recommend that, makes it much harder to do summary statistics later on.</description>
      <pubDate>Fri, 19 Oct 2018 17:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506070#M1253</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T17:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506077#M1256</link>
      <description>&lt;P&gt;I will try the second one, I was looking at the first one.&amp;nbsp; The reason I was thinking of having it as character is because I will want to concatenate all of those variables to see which emails people received and with the '.' it would serve as a placeholder so I wouldn't lose that email even though they might not have gotten it.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506077#M1256</guid>
      <dc:creator>hjones_6</dc:creator>
      <dc:date>2018-10-19T17:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506083#M1257</link>
      <description>Having the variable as text or numeric won't really change that ability. You can still you CATT or CATX to simplify. The only thing that may simplify this, is having a  common prefix that is used only for those variables then you can short cut reference them using a colon rather than having to list out all variables. &lt;BR /&gt;email_flags:</description>
      <pubDate>Fri, 19 Oct 2018 17:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506083#M1257</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T17:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506487#M1333</link>
      <description>&lt;P&gt;Hi, I tried the code that you suggested but I am still getting this output: a 0 for email1_email_opened when email1 was 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if you could walk me through this line of code to help understand what it is saying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AA01044_EMAIL_OPENED_dummy =  (AA01044_EMAIL_OPENED = 'Y');&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 15:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506487#M1333</guid>
      <dc:creator>hjones_6</dc:creator>
      <dc:date>2018-10-22T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506491#M1335</link>
      <description>&lt;P&gt;Please post some sample data and the code you actually ran.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the line you're asking about, the right hand side of the equation is testing if the variable is equal to Y. In SAS true is returned as 1 and false as 0, so you can avoid the IF/THEN portion and just check if they're equal and get the desired values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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/220905"&gt;@hjones_6&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I tried the code that you suggested but I am still getting this output: a 0 for email1_email_opened when email1 was 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you could walk me through this line of code to help understand what it is saying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;AA01044_EMAIL_OPENED_dummy =  (AA01044_EMAIL_OPENED = 'Y');&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 16:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506491#M1335</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-22T16:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dummy Variables as Characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506512#M1340</link>
      <description>&lt;P&gt;Thank you for walking me through that, I had thought that was what was going on but I was not sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sample code and sample data. I attached a screen capture of the output as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample_data;
	input email1 $ email1_email_opened $ email1_email_clicked $;
	datalines;
	N N N
	Y N N
	Y Y N
	Y Y Y
	;
proc print data=sample_data;
run;

data sample_data2;
set sample_data;
if email1 = 'Y' then email1_Dummy = 1;
else do;
    email1_Dummy = 0;
    call missing(email1_email_opened_dummy, email1_click_dum);
end;
email1_EMAIL_OPENED_dummy =  (email1_EMAIL_OPENED = 'Y');
if email1_EMAIL_OPENED_dummy = 0 then call missing(email1_click_dum);
if email1_EMAIL_CLICKED = 'Y' then email1_click_dum = 1;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;l&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="email_dummies.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24243iAF3AAA50B1E2E032/image-size/large?v=v2&amp;amp;px=999" role="button" title="email_dummies.JPG" alt="email_dummies.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 16:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-Dummy-Variables-as-Characters/m-p/506512#M1340</guid>
      <dc:creator>hjones_6</dc:creator>
      <dc:date>2018-10-22T16:24:38Z</dc:date>
    </item>
  </channel>
</rss>

