How can I add titles in SAS, and what are some examples? 2

How can I add titles in SAS, and what are some examples?

SAS (Statistical Analysis System) is a software used for data analysis and management. In order to add titles in SAS, one can use the TITLE statement, which allows users to include a title at the top of their output. This can be done by simply writing the desired title within quotation marks after the TITLE statement. Additionally, users can customize the title by utilizing various options such as font, color, and size. Some examples of titles in SAS could be “Sales Analysis Report” or “Customer Satisfaction Survey Results.” The use of titles in SAS not only helps in organizing and labeling output, but also adds a professional touch to the presentation of data.

Add Titles in SAS (With Examples)


You can use the title statement in SAS to quickly add a title to a table or chart.

This statement uses the following basic syntax:

Method 1: Add One Title

/*define title*/title "This is a title";

/*view dataset with title*/proc printdata=my_data;

Method 2: Add Multiple Titles

/*define titles*/title1color="purple" height=25pt bolditalic underline=1 "This is a Title";
title2font="Helvetica" justify=left height=18pt "Second Title";
title3color="green" justify=right height=14pt "Third Title";

/*view dataset with title*/proc printdata=my_data;

Note the following statements that you can use to modify the titles:

  • color: The font color
  • height: The font size
  • font: The font family
  • justify: The location of the title (left, right, center)
  • style: Use “bold”, “italic”, or “underlin” to modify the font style

The following examples show how to use each method in practice.

Example 1: Add One Title

The following code shows how to add one title to a dataset in SAS:

/*create dataset*/
data original_data;
    input team $ points rebounds;
    datalines;
A 25 10
A 18 4
B 27 9
B 33 13
;
run;

/*view dataset*/
title "This is a title";
proc printdata=original_data;

sas add a title

Example 2: Add Multiple Titles

The following code shows how to add multiple titles with custom designs to a dataset in SAS:

/*create dataset*/
data original_data;
    input team $ points rebounds;
    datalines;
A 25 10
A 18 4
B 27 9
B 33 13
;
run;

/*view dataset*/
title1color="purple" height=25pt bolditalicunderlin=1 "First Title";
title2font="Helvetica" justify=left height=18pt "Second Title";
title3color="green" justify=right height=14pt "Third Title";
proc printdata=original_data;

Additional Resources

The following tutorials explain how to perform other common tasks in SAS:

Cite this article

stats writer (2024). How can I add titles in SAS, and what are some examples?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-add-titles-in-sas-and-what-are-some-examples/

stats writer. "How can I add titles in SAS, and what are some examples?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-add-titles-in-sas-and-what-are-some-examples/.

stats writer. "How can I add titles in SAS, and what are some examples?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-add-titles-in-sas-and-what-are-some-examples/.

stats writer (2024) 'How can I add titles in SAS, and what are some examples?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-add-titles-in-sas-and-what-are-some-examples/.

[1] stats writer, "How can I add titles in SAS, and what are some examples?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.

stats writer. How can I add titles in SAS, and what are some examples?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top