Help using Base SAS procedures

Use a formula in a TITLE statement

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Use a formula in a TITLE statement

I am trying to create a table using the following code using SAS 9.4.  The parameter value &rptyr is a four-character integer (representing the year of the report).  I would like TITLE3 to provide the following result, and the code I am using below is only the most recent of several unsuccessful approaches at achieving this result:

 

Race and Gender Breakdown of All Students from Fall 2015 to Spring 2016 

 

proc tabulate data=srkdemog_ath out=srkdemog_all;
	var athlete;
	class state campus_code campus_desc ethnicity gender bid;
	table all='College' ethnicity='' gender='',
		(all='College' state=''*campus_code='Campus'*campus_desc='')*athlete=''*n='Total'*f=comma8.;
	title 'Student Right-to-Know Graduation Rate';
	title2 'Student Athletes';
	title3 "Race and Gender Breakdown of All Students from Fall %sysfunc(put(&rptyr-1,4.)) to Spring &rptyr";
	run;

 

Any assistance towards achieving this goal would be welcome.  Thank you.

 

Marc

 


Accepted Solutions
Solution
‎10-25-2016 10:25 AM
Super User
Posts: 17,912

Re: Use a formula in a TITLE statement

%EVAL instead of PUT and SYSFUNC?

View solution in original post


All Replies
Solution
‎10-25-2016 10:25 AM
Super User
Posts: 17,912

Re: Use a formula in a TITLE statement

%EVAL instead of PUT and SYSFUNC?

Occasional Contributor
Posts: 12

Re: Use a formula in a TITLE statement

This worked perfectly. Thanks!
Super User
Posts: 5,093

Re: Use a formula in a TITLE statement

%SYSFUNC does not support the PUT function.  You can switch to the PUTN function instead.  Once you do that, you may have to experiment with the third parameter (it may need to go in quotes).

Occasional Contributor
Posts: 12

Re: Use a formula in a TITLE statement

I tried this as well, since you took the time to answer, and using PUTN instead of PUT also worked, so thank you!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 301 views
  • 2 likes
  • 3 in conversation