BookmarkSubscribeRSS Feed
mcgannmary1
Obsidian | Level 7

Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error

 

"NOTE: ODS PDF(EGPDF) printed no output.

(This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)"

 

Here is the code I'm trying to run.

 

data=work.oahbl_20190619;
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;
run;

 

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.

 

Thank you in advance!

Best,

Mary

2 REPLIES 2
Reeza
Super User

You have no SET statement, so you've never specified an input data set so you have no data to create new variables.

 

And your PROC FREQ doesn't reference any data set so not sure what it's referring to either.

 

See the items in orange below

data work.oahbl_20190619;
SET INPUT_DATA_SET;

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 DATA=oahbl_20190619;
run;

 

EDIT: Corrected as indicated by @Astounding 


@mcgannmary1 wrote:

Hi, I'm trying to write a simple If , Then, Else Statement and run frequencies, but I keep getting this error

 

"NOTE: ODS PDF(EGPDF) printed no output.

(This sometimes results from failing to place a RUN statement before the ODS PDF(EGPDF) CLOSE statement.)"

 

Here is the code I'm trying to run.

 

data=work.oahbl_20190619;
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;
run;

 

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.

 

Thank you in advance!

Best,

Mary


 

Astounding
PROC Star
Two additional issues to consider...

Remove the equal sign from the DATA statement. It doesn't belong there.

Read the log. Pay attention to the messages there. SAS is trying to tell you what went wrong.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 877 views
  • 2 likes
  • 3 in conversation