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
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
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.
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.
Ready to level-up your skills? Choose your own adventure.