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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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