BookmarkSubscribeRSS Feed
mmkr
Quartz | Level 8

data check;
input name $ age;
cards;
abc 10
def 11
ghj 23
kld 45
;
run;

ods pdf file="test.pdf" bookmarklist=none ;
proc report data=check;
columns name age;
define name / "Name";
define age / "Age";

/*if age is greater than 19 */

/*then i want body of text says Age is greater than 19 you can enter */

run;
ods pdf close;

3 REPLIES 3
PaigeMiller
Diamond | Level 26
proc format;
    value agef 19-high='Age is greater than 19';
run;

ods pdf file="test.pdf" bookmarklist=none ;
proc report data=check;
columns name age;
define name / "Name";
define age / "Age" format=agef.;
run;
ods pdf close;
--
Paige Miller
mmkr
Quartz | Level 8

I don't want in to the table 

 

I want text in the body of the report like below !!

 

mmkr_0-1721132627035.png

 

PaigeMiller
Diamond | Level 26
ods pdf file="test.pdf" bookmarklist=none ;
proc report data=check;
    columns name age;
    define name / "Name";
    define age / "Age";
run;

proc sql noprint;
    select max(age) into :maxage from check;
quit;
%if &maxage>19 %then %do; 
    ods escapechar='^';
    ods text ="^{style [just=c]}Age is greater than 19" ;
%end;
ods pdf close;
--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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