<?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: how do I use if/and/delete statement to delete sex-dependent values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752468#M80753</link>
    <description>Thank you!! This worked, much appreciation</description>
    <pubDate>Tue, 06 Jul 2021 23:56:29 GMT</pubDate>
    <dc:creator>ayosas</dc:creator>
    <dc:date>2021-07-06T23:56:29Z</dc:date>
    <item>
      <title>how do I use if/and/delete statement to delete sex-dependent values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752464#M80751</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set ile.nhanes2016 (keep= SMQ040 IMQ060 IMQ070 IMQ100 RIAGENDR 
RIDAGEYR DMDCITZN DMDMARTL BMXBMI DMDEDUC2 INDHHIN2
MCQ220);
if IMQ070=. and IMQ060=. then delete;
run;

proc freq data=ile.nhanes2016;
tables IMQ060 IMQ070 / nocum missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;IMQ070 value is for males and IMQ060 is for females. Subjects have a value for one and not the other. I want to delete missing values. After running the code missing values remain for both males and females, is there something wrong with my code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="proc_title_group"&gt;&lt;P class="c proctitle"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-07-06 at 7.10.45 PM.png" style="width: 249px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61002i0B69C82A90EC45F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-07-06 at 7.10.45 PM.png" alt="Screen Shot 2021-07-06 at 7.10.45 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Jul 2021 23:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752464#M80751</guid>
      <dc:creator>ayosas</dc:creator>
      <dc:date>2021-07-06T23:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use if/and/delete statement to delete sex-dependent values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752465#M80752</link>
      <description>You're only deleting records where BOTH are missing, you want to delete records where either are missing and use OR instead of AND.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if IMQ070=. or IMQ060=. then delete;&lt;BR /&gt;&lt;BR /&gt;However, since you can only be one, I don't think that's what you want either as that will delete all record essentially since the other one will always be the opposite. &lt;BR /&gt;&lt;BR /&gt;I would suggest creating a new variable HPV vaccine:&lt;BR /&gt;&lt;BR /&gt;HPV_Vaxx = coalesce(IMQ070, IMQ060);&lt;BR /&gt;if missing(IMQ070) then gender=0; else gender=1;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jul 2021 23:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752465#M80752</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-06T23:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: how do I use if/and/delete statement to delete sex-dependent values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752468#M80753</link>
      <description>Thank you!! This worked, much appreciation</description>
      <pubDate>Tue, 06 Jul 2021 23:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-do-I-use-if-and-delete-statement-to-delete-sex-dependent/m-p/752468#M80753</guid>
      <dc:creator>ayosas</dc:creator>
      <dc:date>2021-07-06T23:56:29Z</dc:date>
    </item>
  </channel>
</rss>

