|Date: ||Fri, 24 May 2002 15:11:12 -0400|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|Subject: ||Re: TITLE - include the contents of a variable?|
There are good reasons why your code did not work.
A TITLE statement is not really part of a PROC or DATA step. It can be
placed before any step, or between steps, or after all steps (in which case
it does nothing). Also, it persists. In other words, in which data set does
Moreover, a TITLE statement does not in general vary (exception noted
below), while a variable's value can change from observation to observation.
In other words, which value of YEAR do you want?
If the TITLE is for output of a PROC step and if YEAR is a BY variable, see
TITLE statement documentation for the #BYVAR, #BYVAL, and #BYLINE
constructs. This is the exception to the "titles do not vary" rule.
For a DATA step, you would use PUT statements rather than TITLE statements
to create headings.
On Fri, 24 May 2002 17:54:20 GMT, Elise Beauregard
>How do you include the contents of a variable in a TITLE?
>I want to include the variable YEAR in the title, and I know this doesn't
>ex: TITLE 'Academic year' YEAR;
>result: Academic year 2001