<?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: ODS odf Error when trying to use If, Else, Then statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567433#M75131</link>
    <description>&lt;P&gt;You have no SET statement, so you've never specified an input data set so you have no data to create new variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And your PROC FREQ doesn't reference any data set so not sure what it's referring to either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the items in orange below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.oahbl_20190619;
&lt;STRONG&gt;&lt;FONT size="4" color="#FF6600"&gt;SET INPUT_DATA_SET;&lt;/FONT&gt;&lt;/STRONG&gt;

IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD';
ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD';
ELSE BCCURRMETH2='MISSING';
run;

proc freq &lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt;DATA=oahbl_20190619&lt;/STRONG&gt;&lt;/FONT&gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Corrected as indicated by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276963"&gt;@mcgannmary1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"NOTE: ODS PDF(EGPDF) printed no output.&lt;/P&gt;
&lt;P&gt;(This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code I'm trying to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data=work.oahbl_20190619;&lt;BR /&gt;IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE BCCURRMETH2='MISSING';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc freq;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried adding an ODS close statement as the note suggested, but that doesn't make any difference. I'm still not able to creae theis new BCCURRMETH2 variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Mary&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 15:01:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-06-20T15:01:53Z</dc:date>
    <item>
      <title>ODS odf Error when trying to use If, Else, Then statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567430#M75130</link>
      <description>&lt;P&gt;Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"NOTE: ODS PDF(EGPDF) printed no output.&lt;/P&gt;&lt;P&gt;(This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I'm trying to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=work.oahbl_20190619;&lt;BR /&gt;IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE BCCURRMETH2='MISSING';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding an ODS close statement as the note suggested, but that doesn't make any difference. I'm still not able to creae theis new BCCURRMETH2 variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Mary&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 19:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567430#M75130</guid>
      <dc:creator>mcgannmary1</dc:creator>
      <dc:date>2019-06-19T19:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: ODS odf Error when trying to use If, Else, Then statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567433#M75131</link>
      <description>&lt;P&gt;You have no SET statement, so you've never specified an input data set so you have no data to create new variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And your PROC FREQ doesn't reference any data set so not sure what it's referring to either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the items in orange below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.oahbl_20190619;
&lt;STRONG&gt;&lt;FONT size="4" color="#FF6600"&gt;SET INPUT_DATA_SET;&lt;/FONT&gt;&lt;/STRONG&gt;

IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD';
ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD';
ELSE BCCURRMETH2='MISSING';
run;

proc freq &lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt;DATA=oahbl_20190619&lt;/STRONG&gt;&lt;/FONT&gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Corrected as indicated by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276963"&gt;@mcgannmary1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"NOTE: ODS PDF(EGPDF) printed no output.&lt;/P&gt;
&lt;P&gt;(This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code I'm trying to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data=work.oahbl_20190619;&lt;BR /&gt;IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla)' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE IF BCCURRMETH='Hormonal IUD ( Mirena, Liletta, or Skyla),Condoms' THEN BCCURRMETH2='Hormonal IUD';&lt;BR /&gt;ELSE BCCURRMETH2='MISSING';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc freq;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried adding an ODS close statement as the note suggested, but that doesn't make any difference. I'm still not able to creae theis new BCCURRMETH2 variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Mary&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 15:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567433#M75131</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-20T15:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: ODS odf Error when trying to use If, Else, Then statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567537#M75134</link>
      <description>Two additional issues to consider...&lt;BR /&gt;&lt;BR /&gt;Remove the equal sign from the DATA statement.   It doesn't belong there.&lt;BR /&gt;&lt;BR /&gt;Read the log.  Pay attention to the messages there.  SAS is trying to tell you what went wrong.</description>
      <pubDate>Thu, 20 Jun 2019 06:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ODS-odf-Error-when-trying-to-use-If-Else-Then-statement/m-p/567537#M75134</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-20T06:02:41Z</dc:date>
    </item>
  </channel>
</rss>

