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-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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.

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
  • 298 views
  • 2 likes
  • 3 in conversation